-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented MoreTidemanAndChieruzzi, K84R from Axelrod's second #1147
Conversation
…o TidemanChieruzz Conflicts: axelrod/tests/strategies/test_axelrod_second.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good, just the tiny typo.
I'm not entirely following the logic equivalence just yet. Could you walk me through this:
The biggest change in my refactoring was to change the way JDR was used, by calculating this as a triangle number:
Thanks 👍 :)
axelrod/strategies/axelrod_second.py
Outdated
Strategy submitted to Axelrod's second tournament by T. Nicolaus Tideman | ||
and Paula Chieruzzi (K84R) and came in ninth in that tournament. | ||
|
||
This strategy Cooperates if this player's socre exceeds the opponent's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
score
@drvinceknight Sure. https://github.com/Axelrod-Python/TourExec/blob/v0.2.0/src/strategies/k84r.f#L18 says: IF (IS - JS - DS - 5 * JDR * (JDR - 1) / 2 .GE. 0) I moved the term 5 * JDR * (JDR - 1) / 2 to the right-hand side of the inequality and called it |
AH yes! I see it now. Makes a lot of sense. 👍 |
self.last_fresh_start = current_round | ||
self.fresh_start = False | ||
return C # Second cooperation | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain the name opponent_CDd
? I looks like it's just checking that opponent.history[-2:] == [C, D]
right? Just curious what the final d
indicates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct. The second d is because "CDd" is the past tense of "CD."
FPs below.
This was similar in some ways to TidemanAndChieruzzi from the first tournament, so I tried to make my function implementation similar to the that one.
The biggest change in my refactoring was to change the way JDR was used, by calculating this as a triangle number: https://github.com/Axelrod-Python/TourExec/blob/v0.3.0/src/strategies/k84r.f#L18