Skip to content

Adding grumpy.py - #11

Merged
drvinceknight merged 5 commits into
Axelrod-Python:masterfrom
JasYoung315:patch-7
Feb 19, 2015
Merged

drvinceknight merged 5 commits into
Axelrod-Python:masterfrom
JasYoung315:patch-7

Conversation

@JasYoung315

Copy link
Copy Markdown
Contributor

Adding grumpy. This strategy chooses a strategy based on two thresholds which depend on the history of the opponent.

@drvinceknight

Copy link
Copy Markdown
Member

Hi @JasYoung314 thanks a lot for the pull request: the grumpy strategy looks cool (thanks also for the tests!).

I note that the strategy keeps another attribute (the state: grumpy or not). This is something that will need to be reset at every repetition of a duel in the tournament. I've actually just changed how reset works with this commit: 3d06104

Could you add a specific reset method to the Grumpy class so that it not only resets history and score but also the state (you'll have to add the method so that it overwrites the reset method it inherits).

@drvinceknight

Copy link
Copy Markdown
Member

(this commit also: 376d9cf)

same as the parent class but will reset state to be the same as in init
@JasYoung315

Copy link
Copy Markdown
Contributor Author

Thanks @drvinceknight I have made the change to the grumpy player class you requested.

@drvinceknight

Copy link
Copy Markdown
Member

Nice: could you just add a test for the reset method in the grumpy class? Once you've done that I'll merge!

@JasYoung315

Copy link
Copy Markdown
Contributor Author

@drvinceknight the reset method is now tested for grumpy

drvinceknight added a commit that referenced this pull request Feb 19, 2015
@drvinceknight
drvinceknight merged commit 8295fc6 into Axelrod-Python:master Feb 19, 2015
marcharper pushed a commit to marcharper/Axelrod that referenced this pull request Nov 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants