Modelling the social influence in the iterated prisoner's dilemma using a network with Facebook data
Explore the docs »
Table of Contents
This Github Repository provides the code and corresponding results of an Agent-Based-Modelling (ABM) research performed by Enno Kuyt, Susy Maijer, Sven Poelmann, Marija Puljic and Jingxin Xu. For this research, it was sought to model social influence in the iterated prisoner's dilemma using a network based on real facebook data. The next sections provide an overview of the requirements, usage and references.
The following frameworks were utilised to create the models in our code. Some examples that can be found in the corresponding documentations served as inspiration for parts of our own code.
In this Readme, it is assumed that the reader has a working python environment, including a jupyter notebook framework.
The packages that are required and how to install them (using pip) are as follows:
- mesa
pip install mesa
- axelrod
pip install axelrod
- networkx
pip install networkx
- SALib
pip install SALib
To reproduce the results, only the ABM_Classes_SA.ipynb, ABM_Plots.ipynb and ABM_stochastic_simulation.ipynb files need to be downloaded. These then need to be put in the same folder, and opened with Jupyter Notebook. In case the sensitivity analysis is too time-consuming, one could also download the files that are found in the output_data folder. These should be saved to the same folder as the notebook files. If that is the case, one can skip Step 1 of the Usage section and only execute Step 2.
-
Open the ABM_Classes_SA.ipynb file and run all cells. The second-to-last cell will run the OFAT SA, the last cell will run the Sobol SA. If everything functioned properly, all required files will be saved to the working folder.
-
Open the ABM_Plots.ipynb file and run all cells. The output data files should be in the working folder for the cells to run without errors. The figures are shown in the notebook, and are also saved to the working folder.
The resulting plots can be used for analysis, reports and presentations. To reproduce the stochastic simulations performed for stability analysis and the creation of the base case, one should use the functions provided in ABM_stochastic_simulation.ipynb. These must be copied to the ABM_Classes_SA.ipynb file to work properly. These were left out of the main ABM file to keep the main file organised and clear for the reader.
Enno Kuyt - enno.kuyt@hotmail.com
Susy Maijer - susy.maijer@student.uva.nl
Sven Poelmann - s.poelmann@xs4all.nl
Marija Puljic - marija.puljic3@gmail.com
Jingxin Xu - jingxin.xu.002@gmail.com
Project Link: https://github.com/ennokuyt/ABM