Anthropoids

Jakson Alves de Aquino
jalvesaq@gmail.com

 

About

Anthropoids is an agent based model of the evolution of cooperation among virtual anthropoids.

 

Compile

You will need the Xlib and the GNU Scientific Library headers. Under Debian, Ubuntu, and derived distributions, the following command will install all necessary packages to compile and run anthropoids:

sudo apt-get install make g++ libx11-dev libgsl0-dev xpdf-reader r-base-core
After installing the dependencies, open a terminal emulator, go to anthropoids directory, and type "make".

 

Run

With anthropoids already compiled, type in the terminal:

./anthropoids
While the program is running, you can use the mouse's left button to click on on agents and see what happens with them. The application will show a list of agents present in the selected cell. If you click in one of the listed agents, the program will draw lines linking the agent and all other agents that it remembers and that are not in the same cell. Blue lines represent positive remembrances; red lines, negative remembrances; and, white lines, neutral. The events happening with the selected agent will be printed in the terminal.

You can generate a pdf file with graphics by clicking in the corresponding button (and waiting...).

 

Change parameters

If you do not change the parameters, each simulation will be a repetition of the other. To get different "histories", it is necessary to change the random seed passing the parameter "-s" to anthropoids followed by a number. Example:

./anthropoids -s 237243
Using a different seed do not change the average initial values of the variables: you have to edit the file "parameters". This file is created when you run anthropoids for the first time.

It is possible avoid the creation of terrestrial herbaceous vegetation and trees in some regions of the world by editing the picture "gridTemplate.pbm". No vegetation will be created under the coordinates corresponding to the black color. The file "gridTemplate.pbm" might be created by using R (as exemplified in the script createGrid.R) or by using a image manipulation program, like The Gimp.

 

Collect data for statistical analysis

To collect data, edit the file "parameters" and change to an integer number higher than 0 the value of LogInterval. During the simulation, the files "completeRun.csv" and "deadOnes.csv" will be continuously fed with data. These files have, respectively, general data and detailed information about the agents who died in the last cycle. There are other two files. One of them is "entirePop.csv", which has the almost the same variables of "deadOnes.csv", but with data from agents that were alive when the file was created. The other is "agRemembrances.csv", which has the all remembrances of all agents that were alive when the file was created, excluding the remembrances that live agents keep of already dead ones. These two files are generated at the end of the simulation, but they can also be created at any time by sending the signal USR2 to anthropoids. You can send this signal with the following command:

killall -s USR2 anthropoids
Without parameters, the command "killall" kills the program by sending the SIGTERM signal. The option "-s USR2" means that the signal to be sent must be "USR2" (Second User Defined Signal).

You can run anthropoids without graphics (even without X Server). To run anthropoids in batch mode, you have to add the option "-b", as below:

./anthropoids -b -s <number>
In this case, the simulation duration will be defined by the value of "ExperimentDuration" which might be defined in the file "parameters". If you do not want to wait for "ExperimentDuration", you can terminate the simulation at any moment with the command:

killall -s USR1 anthropoids