def __init__(self, p_sneaky=0.1): d = "JOSS defaults to cooperation on the first turn, and "+\ "thereafter mirrors its partner's previous move, except after its "+\ "partner cooperates JOSS defects with some probability to see what "+\ "it can get away with every once in a while." BotPlayer.__init__(self, "JOSS_" + str(p_sneaky), description=d) self.p_sneaky = p_sneaky
def __init__(self): d = "TESTER initially defects to test what the other player will do. "+\ "If the other player defects ever, TESTER apologizes by cooperating "+\ "and then mirrors the partner's moves thereafter. If the other "+\ "player does not retaliate, TESTER cooperates twice but then defects "+\ "on and off every other turn." BotPlayer.__init__(self, "TESTER", description=d)
def __init__(self, p_sneaky=0.1): d = "JOSS defaults to cooperation on the first turn, and "+\ "thereafter mirrors its partner's previous move, except after its "+\ "partner cooperates JOSS defects with some probability to see what "+\ "it can get away with every once in a while." BotPlayer.__init__(self, "JOSS_"+str(p_sneaky), description=d) self.p_sneaky = p_sneaky
def __init__(self): d = "PAVLOV defaults to cooperation on the first turn, and "+\ "thereafter cooperates if and only if both players made the same "+\ "choice last turn. This is known as 'win-stay, lose-shift', because "+\ "PAVLOV repeats its own last move after it receives T or R (the good "+\ "scores) and changes its move after it receives P or S (the bad "+\ "scores), like a reflex demonstrated in Pavlov's dog experiment." BotPlayer.__init__(self, "PAVLOV", d)
def __init__(self, p_generous=0.1): d = "GENEROUS_TIT_FOR_TAT defaults to cooperation on the first turn, "+\ "and thereafter mirrors its partner's previous move, except after "+\ "its partner defects GENEROUS_TIT_FOR_TAT cooperates with some "+\ "probability to forgive occasional mistakes and avoid unnecessary "+\ "mutual punishment." BotPlayer.__init__(self, "GENEROUS_TIT_FOR_TAT_"+str(p_generous),\ description=d) self.p_generous = p_generous
def __init__(self, p_cooperate=0.5): d = "CHAMPION cooperates for about 1/20 of the expected length of "+\ "interaction, mirrors its partner's previous move for about 3/40 of "+\ "the expected length of interaction, and then cooperates unless all "+\ "three of the following conditions are true: its partner defected "+\ "last turn, its partner cooperated less than 60% of the time, and "+\ "a randomly generated number between 0 and 1 is less than its "+\ "partner's defection rate." BotPlayer.__init__(self, "CHAMPION", description=d)
def __init__(self, nice=True): d = "STATBOT cooperates, then defects, then after that calculates its average score per move"+\ " for cooperation and defect and chooses whichever one is higher, in the case of a tie, "+\ "NICE_STATBOT cooperates and MEAN_STATBOT defects" self.nice = nice if nice: n = 'NICE_STATBOT' else: n = 'MEAN_STATBOT' BotPlayer.__init__(self, n, d)
def __init__(self, soft=True): d = "MAJORITY cooperates as long as its partner has cooperated more "+\ "than it has defected (if partner has cooperated and defected equal "+\ "amounts, MAJORITY cooperates if it is soft and defects if it is "+\ "hard)." if soft: name = "MAJORITY_SOFT" else: name = "MAJORITY_HARD" BotPlayer.__init__(self, name, description=d) self.soft = soft
def __init__(self, optimistic=True): d = "DOWNING tries to maximize expected gains by testing the water "+\ "with its partner. The idea is that if its partner seems responsive "+\ "to what DOWNING is doing, DOWNING will cooperate, but if the other "+\ "player seems unresponsive, DOWNING will try to get away with "+\ "whatever it can by defecting. DOWNING does this by keeping an "+\ "estimate of the probability of the other player cooperating given "+\ "DOWNING's last move. The initial estimates depend on DOWNING's "+\ "outlook (optimistic or pessimistic)." if optimistic: name = "OPT_DOWNING" elif not optimistic: name = "PESS_DOWNING" BotPlayer.__init__(self, name, description=d) self.optimistic = optimistic
def __init__(self): d = "FRIEDMAN is the permanent retaliator. It cooperates until its "+\ "partner defects, after which FRIEDMAN defects for the rest of the "+\ "interaction." BotPlayer.__init__(self, "FRIEDMAN", description=d)
def __init__(self): d = "SUSPICIOUS_TIT_FOR_TAT defaults to defection on the first turn, "+\ "and thereafter mirrors its partner's previous move." BotPlayer.__init__(self, "SUSPICIOUS_TIT_FOR_TAT", description=d)
def __init__(self): d = "ALL_C cooperates unconditionally." BotPlayer.__init__(self, "ALL_C", description=d)
def __init__(self, p_cooperate=0.5): d = "RANDOM chooses randomly between cooperation and defection with "+\ "some specified probability for each, independent of its partner's "+\ "moves." BotPlayer.__init__(self, "RANDOM_" + str(p_cooperate), description=d) self.p_cooperate = p_cooperate
def __init__(self, p_cooperate=0.5): d = "RANDOM chooses randomly between cooperation and defection with "+\ "some specified probability for each, independent of its partner's "+\ "moves." BotPlayer.__init__(self, "RANDOM_"+str(p_cooperate), description=d) self.p_cooperate = p_cooperate
def __init__(self): d = "ALL_D defects unconditionally." BotPlayer.__init__(self, "ALL_D", description=d)
def __init__(self): d = "TWO_TITS_FOR_TAT cooperates unless its partner defects in which "+\ "case TWO_TITS_FOR_TAT retaliates with two defections." BotPlayer.__init__(self, "TWO_TITS_FOR_TAT", description=d)
def __init__(self): ## TODO: read pages 45-46 of Axelrod and describe this d = None BotPlayer.__init__(self, "TRANQUILIZER", d)
def __init__(self): d = "EATHERLY defaults to cooperation, but keeps track of how many "+\ "times the other player has defected, so after a defection by the "+\ "other player, EATHERLY can defect with probability equal to the "+\ "ratio of its partner's defections to the total number of moves so far." BotPlayer.__init__(self, "EATHERLY", d)
def __init__(self): d = "TIT_FOR_TAT defaults to cooperation on the first turn, and "+\ "thereafter mirrors its partner's previous move." BotPlayer.__init__(self, "TIT_FOR_TAT", description=d)
def __init__(self): d = "TIT_FOR_TWO_TATS defects if and only if its partner has "+\ "defected for the past two turns." BotPlayer.__init__(self, "TIT_FOR_TWO_TATS", description=d)