Multi agent simulation code of Spatial Prisoner's Dilemma(SPD) Game on a complex network.
| Example game situation | Time evolution | 
|---|---|
![]()  | 
![]()  | 
| C: Cooperator, D: Defector | Blue: Cooperator, Red: Defector | 
You need to install Python3 with Anaconda distribution.
When running the simulation, just type 
$ python SPD.py 
on your terminal. You can visualize the result with heatmap.py.
$ python heatmap.py 
Depending on the topology and strategy update rule, you can see various Dg-Dr diagram which shows the percentage of cooperative people at evolutionary equilibrium state.
| Imitation max strategy update on lattice | Pairwise-Fermi strategy update on BA-Scale Free network | 
|---|---|
![]()  | 
![]()  | 
Network topology can be selected from these three types.
1. Lattice(2D Grid, default setting)
2. Random Regular Network (Equally mixed network)
3. Barabashi-Albert Scale Free Network (Typically observed in SNS)



