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 Yamachi, k64r from Axelrod's Second. #1163

Merged
merged 2 commits into from
Jan 29, 2018

Conversation

gaffney2010
Copy link
Member

Fingerprints below.

basic_fortran
basic_python

The refactoring is somewhat straight-forward with the exception of https://github.com/Axelrod-Python/TourExec/blob/v0.3.0/src/strategies/k64r.f#L30. Here, I refactored as
P = |E-F|, but E+F = M-1, so that P = |2E+1-M|. Then 10*P < M iff P/(2M) < 0.05. Equivalently, |(E+0.5)/M - 0.5| < 0.05. I called (E+0.5)/M as portion_defect and bounded by 0.45 and 0.55.
Also a little different is I update history before deciding on a move, so to emulate the Fortan (which does after), I wait until the third turn to start (instead of the second) and look back one extra turn.

I think count_them_us_them was intended to be indexed by them_three_ago, us_two_ago, them_last, so that it predicts the opponent's next turn. It kind of predicts the opponents last move instead... [If you look at lines 22 and 23 of the Fortan, it's moving A(X,Y) based on J, but J can't be in response to Y, our own last move.]

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 all looks good to me! Thanks @gaffney2010.

FYI, I've worked through the logic and also run the axelrod_fortran test suite with this strategy.

@meatballs meatballs merged commit a79ccab into Axelrod-Python:master Jan 29, 2018
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