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

K76R Strategy #1102

Closed
meatballs opened this issue Jul 30, 2017 · 6 comments
Closed

K76R Strategy #1102

meatballs opened this issue Jul 30, 2017 · 6 comments

Comments

@meatballs
Copy link
Member

meatballs commented Jul 30, 2017

#This is one of the strategies from Axelrod's Second Tournament for which we have the orginal Fortran code.

A description of this strategy is given in Axelrod, R. (1980). More Effective Choice in the Prisoner’s Dilemma. Journal of Conflict Resolution, 24(3), 379-403, where it is known as 'TESTER':

The rule is unusual in that it defects on the very first move in order to test the other's response. If the other player ever defects, it apologizes by cooperating and playing tit-for-tat for the rest of the game. Otherwise, it defects as much as possible subject to the constraint that the ratio of its defections to moves remains under 0.5, not counting the first defection.

From our analysis of the Fortran code, the strategy:

  • Has a boolean state variable named 'PATSY' which is initialised as True.
    This variable represents whether the strategy currently 'believes' that its opponent can be exploited. i.e. it believes that its opponent is a patsy.
  • Always Defects on the first round. On subsequent rounds:
    • If PATSY is False, play the opponent's last move
    • If PATSY is True and the opponent's last move was D, set PATSY to False and Cooperate
    • If PATSY is True and the opponent's last move was C:
      • Cooperate unless the ratio of (total number of its own cooperations) / (total number of moves) is greater than or equal to 0.5, in which case Defect
@drvinceknight
Copy link
Member

Following a good discussion on this I agree with @meatballs. Note that the textual description mentions "not counting the first defection" to ensure that the ratio "remains" below 0.5. We are in agreement that this is equivalent to simply counting the total number of moves to ensure that the current ratio is below 0.5.

👍

@dmanc
Copy link
Contributor

dmanc commented Aug 3, 2017

I would like to work on this but there is a strategy in axelrod_second.py already called "Tester". It is somewhat different than the description given here so i'm not sure if I should modify it or just make a new class.

@drvinceknight
Copy link
Member

That's great @dmanc!

I suggest the class name for this strategy be Gladstein (the name of the author) but then include Tester in the docstring as one of the other names (also clarify in the docstring that this is based on reverse engineering the Fortran code from the second tournament).

@dmanc
Copy link
Contributor

dmanc commented Aug 4, 2017

Otherwise, it defects as much as possible subject to the constraint that the ratio of its defections to moves remains under 0.5, not counting the first defection.

Cooperate unless the ratio of (total number of its own cooperations) / (total number of moves) is greater than or equal to 0.5, in which case Defect

Just to make sure, these two statements are equivalent right?

@meatballs
Copy link
Member Author

After much debate, yes, we think they are equivalent.

The second statement is a direct description of what the fortran code actually does.

@drvinceknight
Copy link
Member

Closed by #1110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants