Genocide (Epstein Civil Unrest Model 2)
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
This project models inter-ethnic civil violence between two distinct ethnic groups. It is an adaptation of Joshua Epstein's agent-based model of civil violence, specifically his "Model II: Inter-Group Violence" from his 2002 paper "Modeling civil violence: An agent-based computational approach."
The model simulates two ethnic groups (blue and green) that may engage in violent conflict depending on their level of grievance, risk assessment, and the presence of peacekeeping forces. Unlike rebellion against a central authority, this model focuses on horizontal violence between ethnic communities, which can escalate from sporadic incidents to systematic ethnic cleansing or genocide.
HOW IT WORKS
Each agent belongs to one of two ethnic groups (blue or green) determined by the BLUE-GROUP-RATIO parameter. Agents have individual levels of grievance toward the other ethnic group and risk aversion that influences their decision to commit violence.
Grievance Calculation: Each agent's GRIEVANCE is based on their PERCEIVED-HARDSHIP and INTER-GROUP-LEGITIMACY. The grievance formula is: GRIEVANCE = PERCEIVED-HARDSHIP × (1 - INTER-GROUP-LEGITIMACY). Inter-group legitimacy represents each ethnic group's acceptance of the other group's right to exist.
Violence Decision: When agents encounter members of the opposite ethnic group within their vision radius, they may decide to commit violence. This decision follows the rule: if GRIEVANCE - NET-RISK > THRESHOLD, the agent becomes violent. NET-RISK is calculated as the agent's risk aversion multiplied by their estimated arrest probability.
Arrest Probability: Agents estimate their likelihood of arrest based on the ratio of cops to violent agents within their vision, using the formula: ESTIMATED-ARREST-PROBABILITY = 1 - exp(-k × floor(C/A)), where C is the number of cops and A is the number of violent agents in the neighborhood.
Population Dynamics: The model includes birth and death processes. Agents reproduce (clone) with a fixed probability each turn, and offspring inherit their parent's ethnic identity. Agents also have finite lifespans and die of natural causes.
Law Enforcement: Cops move randomly throughout the space and arrest violent agents within their vision. Police bias can be adjusted to favor arresting one ethnic group over another. Arrested agents serve jail terms and are temporarily removed from the population.
Dynamic Cop Density: The number of police can be adjusted during the simulation by converting agents to cops or demobilizing cops back to civilian status.
HOW TO USE IT
Use the sliders to configure the initial parameters:
Initial Settings:
- INITIAL-AGENT-DENSITY: Sets the overall population density
- BLUE-GROUP-RATIO: Determines the percentage split between blue and green ethnic groups
- VISION: Number of patches agents can see in each direction
Dynamic Settings: - INTER-GROUP-LEGITIMACY: Each group's acceptance of the other's right to exist (lower values increase violence) - THRESHOLD: Minimum grievance level required for violence - MOVEMENT?: Toggle whether agents move randomly
Law Enforcement: - COP-DENSITY: Percentage of the population serving as police - POLICE-BIAS: Bias in arrest patterns (-1 favors blue arrests, +1 favors green arrests, 0 is neutral) - MAX-JAIL-TERM: Maximum prison sentence for violent agents
Click SETUP to initialize the population with the specified parameters. Click GO to run the simulation.
The main view displays agents colored by ethnicity (blue/green circles) and activity status (red when violent, grey when jailed). Cops appear as cyan triangles. The population monitors show current counts for each group and the plot tracks population changes over time.
THINGS TO NOTICE
Watch how spatial clustering affects violence dynamics. Areas where one ethnic group predominates may become relatively peaceful, while mixed neighborhoods experience more conflict.
Observe the emergence of "safe havens" when adequate peacekeeping forces are present. These are areas where both ethnic groups can coexist despite tensions.
Notice how small changes in inter-group legitimacy can lead to dramatically different outcomes - from peaceful coexistence to systematic ethnic cleansing.
Pay attention to the role of police bias. Even small biases in law enforcement can exacerbate ethnic tensions and lead to cycles of retaliatory violence.
Watch for "competitive exclusion" dynamics where, without adequate peacekeeping, one ethnic group eventually eliminates the other entirely, similar to ecological competition between species.
THINGS TO TRY
Start with high inter-group legitimacy (0.9) and no police. Observe peaceful coexistence. Gradually reduce legitimacy and note the threshold where violence begins.
Experiment with different police densities. Try starting with no police and adding them mid-simulation to see if violence can be stopped once it begins.
Test the effect of police bias by setting it to favor one group and observing how this affects the conflict dynamics and final outcomes.
Compare gradual versus sudden changes in legitimacy. Does a slow erosion of inter-group relations produce the same dynamics as a sudden crisis?
Try different spatial distributions by adjusting the blue-group ratio. How does the initial mixing of ethnic groups affect subsequent violence patterns?
Run multiple trials with the same parameters to observe the role of randomness. Even identical initial conditions can lead to different outcomes due to the stochastic nature of agent interactions.
EXTENDING THE MODEL
Add communication between ethnic groups to allow reconciliation processes and restoration of legitimacy over time.
Implement economic factors such as resource competition or economic inequality between ethnic groups as additional sources of grievance.
Create heterogeneous police forces with different ethnic compositions and varying levels of effectiveness or bias.
Add external intervention mechanisms such as international peacekeeping forces with different rules of engagement.
Implement refugee dynamics where agents can flee violence and potentially return when conditions improve.
Model the role of ethnic leaders or institutions that could either escalate or de-escalate tensions.
Add memory mechanisms so agents remember past violence and adjust their behavior accordingly.
NETLOGO FEATURES
The model uses breeds to distinguish between agents and cops while maintaining ethnic identity as a separate attribute.
Dynamic breed conversion allows agents to become cops and vice versa, enabling real-time adjustment of police density.
The model implements spatial vision for both risk assessment and violence opportunities, creating realistic local interaction patterns.
Population dynamics with reproduction and natural death maintain demographic realism while allowing for population recovery after violence.
CREDITS AND REFERENCES
This model is based on Joshua M. Epstein's work "Modeling civil violence: An agent-based computational approach," Proceedings of the National Academy of Sciences, Vol. 99, Suppl. 3, May 14, 2002. The original paper is available at https://www.pnas.org/content/99/suppl_3/7243.
Epstein's work built on earlier research in computational social science and agent-based modeling, particularly in understanding how individual-level behaviors aggregate to produce macro-level social phenomena.
HOW TO CITE
If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.
For the original Epstein model:
- Epstein, J.M. (2002). Modeling civil violence: An agent-based computational approach. Proceedings of the National Academy of Sciences, 99(suppl 3), 7243-7250.
Please cite the NetLogo software as:
- Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.
COPYRIGHT AND LICENSE
The original Epstein model is in the public domain as a work published in the Proceedings of the National Academy of Sciences.
This NetLogo implementation follows the same open principles. Users are encouraged to modify and extend the model for research and educational purposes.
NetLogo itself is free software for non-commercial use under the terms of the GNU General Public License (see full license information at https://ccl.northwestern.edu/netlogo/docs/copyright.html).
Comments and Questions
;; =============================================================================== ;; EPSTEIN'S CIVIL VIOLENCE MODEL II: ETHNIC CONFLICT AND GENOCIDE ;; =============================================================================== ;; This model simulates inter-group violence between two ethnic groups (blue and green) ;; with law enforcement attempting to maintain order. Based on Joshua Epstein's ;; agent-based model of civil violence (2002). ;; ;; Key dynamics: ;; - Agents from different ethnic groups may engage in violence against each other ;; - Violence is driven by grievance (hardship + illegitimacy) vs. arrest risk ;; - Cops arrest violent agents, implementing bias through differential enforcement ;; - Population dynamics through agent reproduction (cloning) ;; =============================================================================== ;; =============================================================================== ;; DECLARATIONS ;; =============================================================================== ;; Two breeds: civilian agents (can be violent) and law enforcement (cops) breed [ agents an-agent ] breed [ cops cop ] ;; Global parameters used throughout the simulation globals [ k ; constant factor for arrest probability calculation cloning-probability ; per-turn probability of agent reproduction (0.05) ] ;; Agent and cop attributes turtles-own [ ethnic-group ; 0 = blue group, 1 = green group (retained when converted to/from cop) risk-aversion ; R, individual's risk tolerance (0-1), fixed for lifetime perceived-hardship ; H, economic/social hardship level (0-1) recently-violent? ; boolean: has this agent recently committed violence? (makes them arrestable) violence-timer ; countdown: how many turns agent remains marked as violent jail-term ; countdown: how many turns remain in jail (0 = not jailed) arrest-prob ; calculated probability of arrest (used for bias implementation) ] ;; Patch-level caching for performance optimization patches-own [ neighborhood ; cached agentset of patches within vision radius ] ;; =============================================================================== ;; INITIALIZATION PROCEDURES ;; =============================================================================== to setup clear-all ;; Initialize global constants set k 2.3 ; arrest probability scaling factor set cloning-probability 0.05 ; 5% chance of reproduction per turn per eligible agent ;; Setup patches: color and cache neighborhoods ask patches [ set pcolor gray - 1 ; slightly dark gray background set neighborhood patches in-radius vision ; cache for performance ] ;; Validate density parameters if cop-density + initial-agent-density > 100 [ user-message (word "The sum of cop-density and INITIAL-AGENT-DENSITY " "should not be greater than 100.") stop ] ;; Calculate total population let total-population round ((cop-density + initial-agent-density) * .01 * count patches) ;; STEP 1: Create all individuals as civilian agents first ;; Blue ethnic group create-agents round (total-population * blue-group-ratio / 100) [ move-to one-of patches with [ not any? turtles-here ] set heading 0 set ethnic-group 0 ; blue group identifier set risk-aversion random-float 1.0 set perceived-hardship random-float 1.0 set recently-violent? false ; start peaceful set violence-timer 0 set jail-term 0 display-agent-2d ] ;; Green ethnic group create-agents round (total-population * (100 - blue-group-ratio) / 100) [ move-to one-of patches with [ not any? turtles-here ] set heading 0 set ethnic-group 1 ; green group identifier set risk-aversion random-float 1.0 set perceived-hardship random-float 1.0 set recently-violent? false ; start peaceful set violence-timer 0 set jail-term 0 display-agent-2d ] ;; STEP 2: Convert designated proportion of agents to cops (peacekeepers) let target-cops round (cop-density * .01 * count patches) if target-cops > 0 [ ask n-of (min list target-cops count agents) agents [ set breed cops set recently-violent? false ; cops never engage in ethnic violence display-cop ] ] ;; Initialize simulation clock reset-ticks end ;; =============================================================================== ;; MAIN SIMULATION LOOP ;; =============================================================================== to go ;; Execute behavioral rules for all turtles ask turtles [ ;; Rule M (Movement): Free agents and all cops move randomly within vision if (breed = agents and jail-term = 0) or breed = cops [ move ] ;; Rule V (Violence): Free, peaceful agents check for violence opportunities if breed = agents and jail-term = 0 and not recently-violent? [ check-for-violence-opportunity ] ;; Rule C (Cops): Law enforcement arrests violent agents in their vicinity if breed = cops [ enforce ] ] ;; Population dynamics: agent reproduction (only non-jailed, non-violent agents) ask agents [ if not recently-violent? and jail-term = 0 [ if random-float 1 < cloning-probability [ reproduce ] ] ] ;; Update timers: reduce jail sentences and violence visibility ask agents [ if jail-term > 0 [ set jail-term jail-term - 1 ] if violence-timer > 0 [ set violence-timer violence-timer - 1 if violence-timer = 0 [ set recently-violent? false ] ; violence no longer visible ] ] ;; Dynamically adjust police force size based on slider adjust-cop-density ;; Update visual display ask agents [ display-agent-2d ] ask cops [ display-cop ] ;; Advance simulation clock tick end ;; =============================================================================== ;; AGENT DECISION-MAKING: VIOLENCE ;; =============================================================================== ;; Agents evaluate whether to commit violence against other ethnic groups ;; Decision based on Epstein's grievance-risk model: ;; Violence occurs when: Grievance - (Risk-Aversion × Arrest-Probability) > Threshold to check-for-violence-opportunity let current-neighborhood [neighborhood] of patch-here let my-ethnic-group ethnic-group let potential-targets agents-on current-neighborhood let targets turtle-set [] ;; Identify potential victims: agents of different ethnicity who aren't jailed ask potential-targets [ if ethnic-group != my-ethnic-group and jail-term = 0 [ set targets (turtle-set targets self) ] ] ;; If potential targets exist, calculate decision to attack if any? targets [ let grievance-level grievance let estimated-risk estimated-arrest-probability let net-risk risk-aversion * estimated-risk ;; Decision rule: attack if grievance exceeds risk by threshold if (grievance-level - net-risk > threshold) [ ;; Commit act of violence: eliminate victim let victim one-of targets ask victim [ die ] ;; Become visible as violent (arrestable by cops) set recently-violent? true set violence-timer 3 ; remain visible/arrestable for 3 turns ] ] end ;; =============================================================================== ;; DYNAMIC POPULATION MANAGEMENT ;; =============================================================================== ;; Adjust cop density dynamically by converting between agents and cops ;; Allows real-time changes to policing levels via slider to adjust-cop-density ;; Calculate target cop count based on current slider setting let target-cops round (cop-density * .01 * count patches) let current-cops count cops ;; Recruit more cops if needed (convert peaceful, free agents) if target-cops > current-cops [ let cops-to-recruit (target-cops - current-cops) let available-agents agents with [ jail-term = 0 and not recently-violent? ] let can-recruit min list cops-to-recruit count available-agents if can-recruit > 0 [ ask n-of can-recruit available-agents [ convert-to-cop ] ] ] ;; Demobilize excess cops if needed (convert back to agents) if target-cops < current-cops [ let cops-to-demobilize (current-cops - target-cops) ask n-of cops-to-demobilize cops [ convert-to-agent ] ] end ;; Convert a civilian agent into a cop (recruitment/mobilization) to convert-to-cop set breed cops set recently-violent? false ; cops don't engage in ethnic violence set violence-timer 0 set jail-term 0 ; clear any existing jail time display-cop end ;; Convert a cop back into a civilian agent (demobilization) to convert-to-agent set breed agents ;; Retain civilian attributes: ethnic-group, hardship, risk-aversion set recently-violent? false ; demobilized as peaceful citizen set violence-timer 0 set jail-term 0 ; not jailed upon demobilization display-agent-2d end ;; =============================================================================== ;; MOVEMENT PROCEDURES ;; =============================================================================== ;; Agents and cops move to random empty patches within their vision ;; Empty = no other cops, only jailed agents allowed to move ; turtle procedure if movement? or breed = cops [ let current-neighborhood [neighborhood] of patch-here ;; Find candidate patches: no cops, only jailed agents if any let targets current-neighborhood with [ not any? cops-here and all? agents-here [ jail-term > 0 ] ] if any? targets [ move-to one-of targets ] ] end ;; =============================================================================== ;; AGENT ATTRIBUTES: GRIEVANCE AND RISK ASSESSMENT ;; =============================================================================== ;; Calculate agent's grievance level toward the other ethnic group ;; Based on Epstein's formula: G = H(1 - L) ;; Where H = hardship, L = inter-group legitimacy to-report grievance ;; Legitimacy represents acceptance of other group's right to exist let legitimacy-value max list 0 min list 1 inter-group-legitimacy ;; Incarceration increases hardship perception let effective-hardship perceived-hardship if jail-term > 0 [ set effective-hardship effective-hardship + random-float 0.1 ] ;; Grievance increases with hardship and decreases with legitimacy report max list 0 min list 1 effective-hardship * (1 - legitimacy-value) end ;; Estimate probability of arrest based on local cop/violent-agent ratio ;; Epstein's formula: P = 1 - exp(-k × floor(C/A)) ;; Where C = cops in vision, A = active (violent) agents in vision to-report estimated-arrest-probability let current-neighborhood [neighborhood] of patch-here let c count cops-on current-neighborhood let v 1 + count (agents-on current-neighborhood) with [ recently-violent? ] ;; floor(C/V) creates threshold effect: if V > C, probability ≈ 0 report 1 - exp (- k * floor (c / v)) end ;; =============================================================================== ;; POPULATION DYNAMICS: REPRODUCTION ;; =============================================================================== ;; Agent reproduction through cloning with variation ;; Offspring inherit ethnic group and traits with small mutations to reproduce ;; Find empty neighboring patch for offspring let empty-neighbors neighbors with [ not any? turtles-here ] if any? empty-neighbors [ let target one-of empty-neighbors hatch 1 [ move-to target ;; Inheritance: ethnic group from parent set ethnic-group [ethnic-group] of myself ;; Trait variation: hardship with small random change set perceived-hardship max list 0 min list 1 ([perceived-hardship] of myself + random-normal 0 0.1) ;; New random risk-aversion set risk-aversion random-float 1.0 ;; Born peaceful and free set recently-violent? false set violence-timer 0 set jail-term 0 display-agent-2d ] ] end ;; =============================================================================== ;; LAW ENFORCEMENT: COP BEHAVIOR ;; =============================================================================== ;; Cops arrest violent agents within their vision ;; Implements police bias through differential arrest probabilities to enforce let current-neighborhood [neighborhood] of patch-here ;; Check for any violent agents in vicinity if any? (agents-on current-neighborhood) with [ recently-violent? ] [ let violent-agents1 (agents-on current-neighborhood) with [ recently-violent? ] ;; Calculate arrest probability for each violent agent (implements bias) ask violent-agents1 [ let ethnicity ethnic-group ;; Base arrest probability is 100% set arrest-prob 1 ;; Apply bias: reduce arrest probability for favored group ;; Negative bias favors blue (group 0), positive bias favors green (group 1) if (police-bias < 0 and ethnicity = 0) or (police-bias > 0 and ethnicity = 1) [ set arrest-prob 1 - (abs(police-bias) * 0.5) ; up to 50% reduction ] ] ;; Target agent with highest arrest probability (biased selection) let suspect max-one-of violent-agents1 [arrest-prob] move-to suspect ;; Attempt arrest based on calculated probability if random-float 1 < [arrest-prob] of suspect [ ask suspect [ set recently-violent? false ; no longer visible as violent set violence-timer 0 set jail-term random max-jail-term ; random sentence length ] ] ] end ;; =============================================================================== ;; VISUALIZATION PROCEDURES ;; =============================================================================== ;; Display civilian agents with color coding: ;; RED = recently violent (arrestable) ;; DARK GRAY = jailed ;; BLUE/GREEN = peaceful, showing ethnic group to display-agent-2d ; agent procedure set shape "circle" ifelse recently-violent? [ set color red ] ; violent agents visible to cops [ ifelse jail-term > 0 [ set color black + 3 ] ; jailed agents (dark gray) [ ;; Peaceful agents show ethnic identity ifelse ethnic-group = 0 [ set color blue ] ; blue ethnic group [ set color green ] ; green ethnic group ] ] end ;; Display cops as cyan triangles to display-cop set color cyan set shape "triangle" end ;; =============================================================================== ;; MONITORING REPORTERS ;; =============================================================================== ;; These reporters provide data for plots and monitors ;; Count free blue group agents (not jailed) to-report blue-agents report count agents with [ ethnic-group = 0 and jail-term = 0 ] end ;; Count free green group agents (not jailed) to-report green-agents report count agents with [ ethnic-group = 1 and jail-term = 0 ] end ;; Count currently violent agents (all ethnicities) to-report violent-agents report count agents with [ recently-violent? ] end ;; Count all jailed agents to-report jailed-agents report count agents with [ jail-term > 0 ] end ;; Count violent blue group agents to-report blue-violent report count agents with [ ethnic-group = 0 and recently-violent? ] end ;; Count violent green group agents to-report green-violent report count agents with [ ethnic-group = 1 and recently-violent? ] end ;; Count cops from blue ethnic group to-report blue-cops report count cops with [ ethnic-group = 0 ] end ;; Count cops from green ethnic group to-report green-cops report count cops with [ ethnic-group = 1 ] end
There is only one version of this model, created 8 days ago by Artem Serdyuk.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Genocide (Epstein Civil Unrest Model 2).png | preview | Preview for 'Genocide (Epstein Civil Unrest Model 2)' | 8 days ago, by Artem Serdyuk | Download |
This model does not have any ancestors.
This model does not have any descendants.