-
Notifications
You must be signed in to change notification settings - Fork 1
Fix k61r. #6
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
Conversation
This requires Axelrod-Python/TourExec#6 to work but ensures that k61r behaves as it's supposed to. Closes #62
src/strategies/k61r.f
Outdated
@@ -2,14 +2,15 @@ FUNCTION K61R(ISPICK,ITURN,K,L,R, JA) | |||
C BY DANNY C. CHAMPION | |||
C TYPED BY JM 3/27/79 | |||
k61r=ja ! Added 7/27/93 to report own old value | |||
IF (ITURN .EQ. 1) ICOOP = 0 |
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.
Let's add a comment that this was a new addition
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.
Yeah good call.
src/strategies/k61r.f
Outdated
IF (ITURN .EQ. 1) K61R = 0 | ||
IF (ISPICK .EQ. 0) ICOOP = ICOOP + 1 | ||
IF (ITURN .LE. 10) RETURN | ||
K61R = ISPICK | ||
IF (ITURN .LE. 25) RETURN | ||
K61R = 0 | ||
COPRAT = FLOAT(ICOOP) / FLOAT(ITURN) | ||
IF (ISPICK .EQ. 1 .AND. COPRAT .LT. .6 .AND. R .GT. COPRAT) | ||
z = FLOAT(ICOOP) / FLOAT(ITURN) |
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.
Is this necessary? Seems like it's not...
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.
Woops. My mistake, was trying things!
Closes Axelrod-Python/axelrod-fortran#62 See discussion at that issue. Have written a comment to denote the change.
44f2aec
to
f4f8769
Compare
My best guess as what's going on here: In the documentation for the orginal code , there is a line which says
By default, when a Fortran function returns, all variables within that function become undefined. The However, that option doesn't exist in the compilers we use today. Instead, we have the
Our makefile uses the Presumably, the original |
Awesome investigation, thanks @meatballs, some of this could end up in the paper 👍 |
@meatballs are you ok for me to do a new github release for this or would you prefer to do it? |
Go for it |
On reflection, I don't think this is to do with What we are missing here, I think, is any knowledge of how the original tournament was coded. In our Python implementation, we run all the matches for a tournament within the same session and we are seeing that the maintenance of state across those matches is causing a problem. But what if that's not how the original tournament was run? It's perfectly possible that the matches were run completely independently of one another and this problem would never have arisen. Without the code for the tournament itself, we'll never know. |
Sounds sensible to me. 👍 |
Yeah there's still a missing piece here -- we also have to assumed that ICOOP is initialized to zero on first use so it seems like its matches had to be played in separate invocations of the entire program. Are we sure that no other functions are affected by this bug? |
Sure? No. Pretty sure? Yeah :) I ran the check I mentioned on the |
Closes Axelrod-Python/axelrod-fortran#62
See discussion at that issue.