This repository containts generalization of the code used in our research
In this game
Every individual can play one of two tactics: cooperate(
In each round individuals "play the game" with 8 its neighbors and the average cooperator from this and another field. Tables of payoffs shown below
Table 1: Payoffs for games with neighbors.
payoffs | ||
---|---|---|
0 | 0 | |
1 |
Table 2: Payoffs for games with average cooperator
payoffs | ||
---|---|---|
0 | 0 | |
Where
In general the total payoff
Where
Matrix
Matrix
0 | |
---|---|
0 |
To compile Cython file
pip install -r requirements.txt
make
If you need to test To test
make pytest
One can find example of the usage in notebook example.ipynb.
Two most important thing in compiled file is class
TwoFieldSpatialGame
and function
color_field_change(old_field, new_field)
which accept two 2-D array and returns 3-D array where RED - 0$\to$0 YELLOW - 1$\to$0 GREEN - 0$\to$1 BLUE - 1$\to$1