The following code is an example of a simulation that runs a Prisoner's Dilemma game under one-population discrete-time replicator dynamics.
If you have downloaded the source code, the script is examples/one_population_pd.py
../../../examples/one_population_pd.py