This repository contains a set of java simulations for artificial societies. The simulations are related to the emergence of different cultures (groups of agents with the same features), and how to estabilize them in the presence of noise, and destruction.
The code implements several extensions to the seminal work of Axelrod 1997. It includes mutation, a source of perturbation to the cultural traits as proposed by Klemm et. al 2003, multilateral social influence, initial suggested by Parisi et. al 2003 and Centola et. al 2007, and finally adapted by Flache & Macy 2011 who also introduce another source of noise: selection error. Finally, it also includes institutions as we proposed in Ulloa et. al., including institutional process such as propaganda and democracy.
Apart from that, now it includes catastrophic (or no so catastrophic) events that affects the simulation in execution times. These events simulates catastrophic events such as wars, pests, invasions, attacks to institutions content and structure, and loss of faith in institutions (apostasy), but also not necessarily catastrophic events such as change of noise, democracy or institutional influence rates.
The wiki (user manual) is now available, and a GUI; the [Quick Start] (https://github.com/robertour/cultural-simulations/wiki/A.-Quick-Start) will introduce you very fast.
There is also a Batch Mode and a Command Line Interface to run experimental designs. Statistical analysis of the results is possible through the Output Files.
2023-09-31: This is working again with the latest version of the OpenJDK: openjdk 11.0.20.1 2023-08-24 2021: Install Java 1.7 or 1.8. It also needs to be tested with IcedTea because it was not working a few months ago; if it doesn't, Oracle will have to be.
- If you don't know how to use the terminal/command line, try:
- Download the
culsim.jar
file from here - Right-click in the
culsim.jar
file - Open With...
- Select "Java runtime environment" (if the option doesn't appear, please install Java 7 first)
- After that, a double-click should be enough.
-
Alternatively, you can double-click the
culsim.bat
-
If not open the Windows CMD:
- Go to the directory that contains the
culsim.jar
- Write
java -jar culsim.jar
- Hit Enter
- Press
Ctrol+t
- Go to the directory that contains the
culsim.jar
andculsim.sh
- Write
./culsim.sh
orjava -jar culsim.jar
- Hit Enter
It should be the same as for Linux/Unix users, but I have no relation with macs, so please let me know.
This code was created with the goal of running fast; most of them apply to the Batch Mode or Command Line Interface:
-
All is kept in memory, and I/O access is kept at a minimum.
-
Each simulation is run in a different core. There will be as many threads as your computer has running at the same time. If you have 4 cores, you will have 4 threads (simulations) running simultaneously and the rest waiting for them to finish.
-
The use of objects in the simulation is avoided in the classes that correspond to the core implementation of the simulation. Instead, direct Java Matrices are used. You will see a lot of indices. I did my best to keep decent names for them without being extremely verbose, and it is very well documented.
-
Modularization in the simulation core method is avoided in order to reduce the number of method calls.
-
As a consequence of the previous, the code is repetitive. Each class (that inherits from simulation) re-implement the wheel. You will find that most of the code in
run_experiment
is repetitive, i.e., I didn't factorize intentionally. -
Buffered writers are used, so I/O is reduced, and the output to files is not immediate.