Skip to content

Simple personal testing ground for messing around with strategies in the Prisoner's Dilemma Game

License

Notifications You must be signed in to change notification settings

jedjoud10/game-theory-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Prisoner's Dilemma Test I decided to implement after watching Veritasium's video about it

(also as an efficient way to procrastinate studying for my calculus test)

You can implement your own strategy using the Strategy struct that has the decide function which returns either Decision::Share or Decision::Steal. In the factors.rs there are constants for # of rounds played, # of total entities per strategy pool, and how points are distributed. After two pools go against each other, the score function is called on each strategy to change how each entity should behave based on how well it did last round

Implemented in one afternoon so most of the code is unoptimized and very ugly unfortunately.

All thanks to the textplots crate and owo-colors for beautiful teminal graphs & colors

Plotting # of total points gained VS # of rounds played for each strategy:

image

Histogram showing the most common decision in a play-off between two strategies:

Red depicts "steal", green depicts "share". Anything in between means that multiple entities (of the same pool) have chosen a different value

image

LICENSE

Licensed under

About

Simple personal testing ground for messing around with strategies in the Prisoner's Dilemma Game

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages