-
Notifications
You must be signed in to change notification settings - Fork 262
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
Add test for memory depth #1157
Conversation
This checks that players need at most the memory depth that is described.
This strategy makes use of the cooperation count. It, thus does ont have memory 2.
This ensures it has the correct memory.
It is infinite memory as it defects on last 2 rounds.
Due to reclassification the teams have changed.
@@ -40,7 +40,7 @@ class Geller(Player): | |||
|
|||
name = 'Geller' | |||
classifier = { | |||
'memory_depth': -1, |
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.
FYI: This one I think we did because "it looks into the future" (not suggesting we change it back necessarily).
@@ -22,7 +22,7 @@ class MindReader(Player): | |||
|
|||
name = 'Mind Reader' | |||
classifier = { | |||
'memory_depth': -10, |
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.
Same. I think for these cheating strategies we don't care so much...
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 I thought it was probably due to the "looking in to the future" but taking the notion of infinity to mean "backwards and forwards" I think we're good :) (I agree that we don't care too much :)).
Marking this as good to go: whenever you get a chance @meatballs 👍 |
This writes a test that verifies that the memory depth given in
player.classifier
is an upper bound.It's done using a hypothesis test that only checks a single set of 5 opponents each time so it's not overly expensive (still benefiting from hypothesis's failure database).
This is the commit that writes the test: e9da4f9
Note that it picked up a few mis classifications, that I've fixed here (I'm actually surprised it wasn't more):
DynamicTwoTitsForTat
(strategy makes use of the cooperation count, so it's infinite memory)RandomTitForTat
: classified correctly, I've just tweaked the implementation.SteinAndRapoport
: defects on last two rounds: so it's infinite memory.This closes #1156