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

Add test for memory depth #1157

Merged
merged 9 commits into from
Jan 7, 2018
Merged

Add test for memory depth #1157

merged 9 commits into from
Jan 7, 2018

Conversation

drvinceknight
Copy link
Member

@drvinceknight drvinceknight commented Jan 3, 2018

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

  • c612c1e: DynamicTwoTitsForTat (strategy makes use of the cooperation count, so it's infinite memory)
  • f6479f7: RandomTitForTat: classified correctly, I've just tweaked the implementation.
  • ef130c2: SteinAndRapoport: defects on last two rounds: so it's infinite memory.
  • 483d96e: all the cheating strategies had different (weird/negative) memory depths, I've set them as infinite.

This closes #1156

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

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

@marcharper marcharper Jan 4, 2018

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

Copy link
Member Author

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

@drvinceknight
Copy link
Member Author

Marking this as good to go: whenever you get a chance @meatballs 👍

@meatballs meatballs merged commit 5f527fb into master Jan 7, 2018
@meatballs meatballs deleted the add-test-for-memory-depth branch January 7, 2018 16:12
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.

Add test for memory depth to TestPlayer
3 participants