packages = ["matplotlib", "numpy"]

Play the Spatial Prisoner's Dilemma game

Configure the control panel below and watch a population of agents playing the game.

Paper examples
Make your own configuration
Configurations of the hyper-parameters that give interesting dynamics

Benefit of cooperation:

Percentage of initial cooperators:

Number of rounds:






What do the colors mean?


Press button "Run chaotic dynamics" to run the game in its chaotic regime or configure the hyper-parameters to run a custom simulation. Every pixel in the grid is an agent that plays the Prisoner's Dilemma game against its eight neighbors.