Courses/CS 461/Winter 2006/Justin Padilla/Week 8
From CSWiki
< Courses | CS 461 | Winter 2006 | Justin Padilla
[edit] Prisoner's Dilemma - Genetic
Download here
This version of the Prisoner's Dilemma uses the genetic functions crossover and mutate to change their strategy in order to try and find the best overall strategy.
- There are switches to determine what strategies to use or not.
- The strategies available include: tit-for-tat, tit-for-two-tats, opposite(which chooses the opposite response of its opponent), alternating(goes back and forth between cooperate and defect), defect, cooperate, and moody.
- The moody patches will randomly decide to cooperate or defect, based on the percentage cooperative the user sets the "mood" slider. The higher the percentage, the more often the patches will cooperate.
- Each round, every patch plays a game with each of its neighbors, meaning each patch will play 2 total games with that neighbor, not in succession. Thus each patch will play 16 games per round.
- The plot shows the overall average score of each strategy per round.
- The crossover function causes a patch to take on the strategy of its most successful neighbor(the one with the lowest score).
The interesting thing, which might be a problem, is that the scores always tend to start out varied and gradually reach the same average, no matter what the strategy. I would like to know how to change this, if possible.
I would also like to know a way to adjust the starting amount of patches with each strategy, in a less random way (like a percentage).
Finally, I hope to add a better genetic algorithm which does crossover of multiple patches at a time.

