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

Fix bug in Kluepfel strategy #1260

Merged
merged 2 commits into from
Sep 30, 2019
Merged

Conversation

gaffney2010
Copy link
Member

Happened to catch this bug in an old strategy I submitted.

It didn't match the logic here.
https://github.com/Axelrod-Python/TourExec/blob/master/src/strategies/k32r.f

Shouldn't come up often. It's difficult to construct an example that would have caught this.

@drvinceknight
Copy link
Member

drvinceknight commented Sep 26, 2019

Thank you @gaffney2010

It's difficult to construct an example that would have caught this.

Does that mean asking for a specific test is not realistic? Ideally would be nice to add that.

@gaffney2010
Copy link
Member Author

Does that mean asking for a specific test is not possible? Ideally would be nice to add that.

That's right.

@drvinceknight
Copy link
Member

Cool no problem.

It's hard to review without re translating the source code, I'm sure you're correct but could you perhaps point at lines in the original code that explain what's going on?

@gaffney2010
Copy link
Member Author

There were two errors. (Actually they cancelled each other out on one of the tests.)

Firstly, dc_counts is how many times an opponent responded to my C with a D. So it should be down the branch that self.history[-2]==C and opponent.history[-1]==D. I had mixed up an if/else.

Secondly, the two inequalities that "Check for randomness" come from lines 39-40 on the Fortran; the LHS on line 40 is C4, which is a variable that means "# OF HIS DEF. AFTER MY COOPERATION," and I was accidentally using cc_counts.

@drvinceknight
Copy link
Member

Ok, thanks for the fix and walking me through it 👍

@drvinceknight drvinceknight merged commit 67e61b7 into Axelrod-Python:master Sep 30, 2019
@drvinceknight
Copy link
Member

(great catch!)

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.

3 participants