Axelrod
Axelrod copied to clipboard
Jodoyle29 patch 1
Adding a probabilistic hill climbing algorithm.
This strategy is based on the following assumption: if the opponent is going to defect, it is better to defect. If the opponent is going to confess, it is better to confess. Using a simple probabilistic approach, we can predict the opponents next move and chose to confess/defect accordingly.
Thank you for the feedback. I will make these modifications and work on some tests within the next few days.
I believe I will need some guidance for writing the tests. How can I test for expected behaviour if the behaviour is probability based (I don't know exactly what my strategy will do at each move, I only know what it will probably do)?
You can fix a random seed (or search for seeds) that trigger the expected behaviors. We strive for 100% coverage of the possible behaviors, if possible.
You can fix a random seed (or search for seeds) that trigger the expected behaviors. We strive for 100% coverage of the possible behaviors, if possible.
You can see an example of this here: https://github.com/Axelrod-Python/Axelrod/blob/dev/axelrod/tests/strategies/test_memorytwo.py#L99 (there are a number of other stochastic strategies throughout the library).
See also the code snippet in #1353
See also the code snippet in #1353
Gosh I'd forgotten about that! Yes!!!