How it Works - AdamVD/Prisoners_Dilemma_Simulator GitHub Wiki

General Information on the Iterated Prisoner's Dilemma

The iterative version of the prisoner's dilemma gives the "game" multiple rounds. Each new round has a certain weight, or discount parameter, that is applied to each player's scores for a given round. The formula for retrieving the value of this weight is ωn-1, where 0<ω≤1 and n is the current round number.

Ex: During the fifth round of a simulation between two prisoners when ω=.75, the weight is .754≈.316

In this simulator, the number of rounds in each "game" between two prisoner algorithms is a different random number every game, with a user-defined minimum and maximum. The value for calculating weight, ω, is a user-defined constant that remains the same throughout all "games". This can be changed to a random value if desired. The winner of a given "game" would be the player with the highest number of points upon completion of the random number of rounds, however the result of individual games is not important for this simulator.

Evolution

In order to quickly determine which prisoner algorithm is the most effective when compared to others, a survivial of the fittest type evolution was introduced into the simulator. The steps of this evolutionary process are as follows:

  1. Each prisoner plays every other prisoner exactly once
  2. Prisoner's are sorted by cumulative points from all games
  3. The bottom half of the prisoners are "killed off"
  4. The remaining prisoners "reproduce"
  5. The scores for each prisoner are reset
  6. Back to step one until stopped

In its current state, the simulator is able to handle hundreds of fairly simple prisoners without taking large amounts of time.

⚠️ **GitHub.com Fallback** ⚠️