Skip to content
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

Merged
merged 6 commits into from
Jan 18, 2018

Conversation

gaffney2010
Copy link
Member

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.

all_fortran
all_python

RichardHuffordNotes.pdf

Copy link
Member

@drvinceknight drvinceknight left a 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 :) 👍

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`"agreements",

Copy link
Member Author

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?

Copy link
Member

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).

else:
self.last_four_agreements[self.last_four_index] = 0

# Check is last_aberration is infinite.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if

return C
elif proportion_agree >= 0.625 and last_four_num >= 2:
return opponent.history[-1]
else:
Copy link
Member

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)

self.streak_needed = 21
self.current_streak = 2
self.last_aberration = float("inf")
self.num_abb_coop = 2
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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?

Copy link
Member Author

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.
Copy link
Member

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.

@drvinceknight
Copy link
Member

Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants