The study, published in The Journal for Artificial Societies and Social Stimulation, focuses on two cases of extreme violence, firstly, the conflict commonly referred to as the Northern Ireland Troubles, which is regarded as one of the most violent periods in Irish history.
The conflict, involving the British army and various Republican and Loyalist paramilitary groups, spanned three decades, claimed the lives of approximately 3,500 people and saw a further 47,000 injured.
The three-day period of inter-communal violence between the Hindu and Muslim communities in the western Indian state of Gujarat, began when a Sabarmarti Express train filled with Hindu pilgrims, stopped in the, predominantly Muslim town of Godhra, and ended with the deaths of more than 2,000 people.
Researchers from Oxford University in the UK and Boston University in the US show that people are a peaceful species by nature.
Even in times of crisis, such as natural disasters, people tend to bond and come together.
However, in a wide range of contexts they are willing to endorse violence -- particularly when others go against the core beliefs which define their identity.
The research does not explicitly simulate violence, but, instead focuses on the conditions that enabled two specific periods of xenophobic social anxiety, that then escalated to extreme physical violence.
The findings revealed that the most common conditions that enable long periods of mutually escalating xenophobic tension occur when social hazards, such as outgroup members who deny the group's core beliefs or sacred values, overwhelm people to the point that they can no longer deal with them.
It is only when people's core belief systems are challenged, or they feel that their commitment to their own beliefs is questioned, that anxiety and agitations occur.
However, this anxiety only led to violence in 20 per cent of the scenarios created - all of which were triggered by people from either outside of the group, or within, going against the group's core beliefs and identity.
To create these psychologically realistic AI agents, the team use theories in cognitive psychology to mimic how a human being would naturally think and process information.
The team programmed these rules for cognitive interaction within their AI programme, to show how an individual's beliefs match up with a group situation.
To represent everyday society and how people of different faiths interact in the real world, they created a simulated environment and populated it with hundreds -- or thousands (or millions), of the human model agents.
"Artificial intelligence can help us to better understand the causes of religious violence and to potentially control it," researchers said.