Administrative toolbar

Agent-Based Model for the Evolution of Ethnocentrism

Max Hartshorn
Submitted By: M Hartshorn
Submitted: Mar 29, 2012
Last Updated: Mar 23, 2013
371 Downloads (21 Downloads in the last 3 months)

This is an implementation of an agent based model for the evolution of ethnocentrism. While based off a model published by Hammond and Axelrod (2006), the code has been modified to allow for a more fine-grained analysis of evolutionary dynamics.

In brief, the model consists of a grid populated by agents, each assigned one of four possible arbitrary tags. Agents engage in a one-shot prisoner’s dilemma game with neighboring agents and behave based on predetermined strategy phenotypes towards agents with similar and different tags. Cooperation incurs a slight cost to oneself and accords a respectively higher benefit to the agent being cooperated with. The sum of all costs and benefits for a given agent influences their probability of reproducing an offspring with identical strategy traits in a neighboring empty cell at the end of each cycle. A cycle terminates when all agents have engaged in a one-shot prisoner’s dilemma game with all neighboring agents. (see appendix here for a detailed description)

The simulation allows four possible strategies:

E (ethnocentric) - a strategy of preferential cooperation with one’s ingroup

H (humanitarian) - a strategy of indiscriminate cooperation with all agents

S (selfish) - a strategy of constant non-cooperation

T (traitorous) - a strategy whereby agents cooperate with their outgroup but not their ingroup

Hammond and Axelrod found that ethnocentrism evolved under a variety of parameter settings. We produced this model to better understand the conditions under which ethnocentrism arose. Our discovery of early periods of humanitarian dominance before the ascendancy of ethnocentrism proved particularly intriguing. What are the factors that mitigate the early rise of humanitarians? And what are the factors that mitigate their capitulation to ethnocentrics?

This model is associated with a publication:

Shultz, T. R., Hartshorn, M., & Kaznatcheev, A. (2009). Why is ethnocentrism more common than humanitarianism? In N. A. Taatgen & H. v. Rijn (Eds.), Proceedings of the 31st Annual Conference of the Cognitive Science Society (pp. 2100-2105). Austin, TX: Cognitive Science Society.

Cite This Model:
Hartshorn, Max (2012, March 26). "Agent-Based Model for the Evolution of Ethnocentrism" (Version 2). CoMSES Computational Model Library. Retrieved from:
Model Version: 2 [Latest]
Version Notes:

Programming Language: Java 1.5
Operating System: Platform Independent
Licensed Under: GNU GPL, Version 2
Instructions on Running This Model:
This model is implemented in Java, and requires a Java IDE such as NetBeans or Eclipse to run. The following runs our simulation 10 times with the same default parameters used in our paper. Each simulation lasts 2000 cycles and has a cost to benefit (c/b) ratio of 1/3: 1) Download and unzip 2) Import the project into your workspace using the import function packaged with your IDE (for Eclipse: File -> Import) 3) Create a folder to house the results 4) Create a subfolder within your newly created results directory entitled "benefit-3x-cost" 5) Open the file On line 17 you will see "/*ENTER THE APPROPRIATE FILE PATH HERE*/," below this line, enter the full path to your results directory 6) Save, compile, and run the simulation, and the results will be saved as text files in the benefit-3x-cost/ folder of your results directory. Shell functions make it simple to modify cost/benefit ratio and block certain strategies from evolving. Please download the documentation for more detailed instructions.

Available Model Versions
Version Number Submitted
1 03/24/2012
2 03/26/2012
Community Comments

No comments have been posted yet for this version. You must be logged in to post a comment: Log In.