Skip to content

bsmithgall/prisoners-dilemma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Prisoner's Dilemma Simulator

main.py contains a simulation engine that grabs two random strategies from the strategies module and simulates them an indetermine number of times (0.00346% chance of each round being the final round).

Implementing New Strategies

To implement a new strategy, simply create a new file with the strategy name in the strategies module, import the base class PrisonersDilemmaStrategy from strategies/base.py and override the main method. The base class provides you with whether the strategy is the a strategy or the b strategy, and a property named opposition_strategy, which will give you the proper key for the key/value pairs in the history that is passed when the simulator runs the strategies against each other. For a simple example, look at strategies/always_defect.py, and for a more complex example, look at strategies/joss.py.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages