-
Notifications
You must be signed in to change notification settings - Fork 269
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 RichardHufford strat, K47R from Axelrod's Second. #1162
Conversation
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.
This looks awesome @gaffney2010. Very minor stylistic requests.
FYI, I've run the fortran test suite with this as well (it's a deterministic strategy) and compared to the source code. I confirm everything's implemented correctly :) 👍
axelrod/strategies/axelrod_second.py
Outdated
Strategy submitted to Axelrod's second tournament by Richard Hufford (K47R) | ||
and came in sixteenth in that tournament. | ||
|
||
The strategy tracks opponent "agreements," that is whenever 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.
`"agreements",
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.
I'm not really sure what you're asking for with this one?
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.
Tiny typo I believe: you currently have the comma (,
) inside the quotation marks ("agreements," that
), I believe it should be after the closing quotation mark ("agreements", that
).
axelrod/strategies/axelrod_second.py
Outdated
else: | ||
self.last_four_agreements[self.last_four_index] = 0 | ||
|
||
# Check is last_aberration is infinite. |
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.
Check if
axelrod/strategies/axelrod_second.py
Outdated
return C | ||
elif proportion_agree >= 0.625 and last_four_num >= 2: | ||
return opponent.history[-1] | ||
else: |
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.
No need for the else
(minor)
axelrod/strategies/axelrod_second.py
Outdated
self.streak_needed = 21 | ||
self.current_streak = 2 | ||
self.last_aberration = float("inf") | ||
self.num_abb_coop = 2 |
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.
This is short for "number of aberrations following cooperation" right? In which case I think the abb
is confusing, perhaps:
ab_after_coop_count
ab_after_def_count
?
Happy for other suggestions.
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.
It's cooperations after aberration, so maybe coop_after_abb_count
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.
Cool, sounds good but a single b
(not abb
?): coop_after_ab_count
and def_after_ab_count
?
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.
Because I can't spell. A single b
is good.
@@ -1550,7 +1550,7 @@ def strategy(self, opponent: Player) -> Action: | |||
class Black(Player): | |||
""" | |||
Strategy submitted to Axelrod's second tournament by Paul E Black (K83R) | |||
and came in fourteenth in that tournament. | |||
and came in fifteenth in that tournament. |
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.
As an FYI, this is in essence stepping on #1161. No problem at all (don't change it) but just a headsup.
Thanks! 👍 |
Original here:
/~https://github.com/Axelrod-Python/TourExec/blob/v0.2.0/src/strategies/k47r.f
Attached some refactoring notes. And a large set of fingerprints.
RichardHuffordNotes.pdf