Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self):
Player.__init__(self)
self.cycle = None
def __init__(self, initial=D):
Player.__init__(self)
self.set_four_vector([0, 1, 1, 0])
self._initial = initial
def __init__(self):
Player.__init__(self)
self.opponent_class = None
def __init__(self, initial=C):
Player.__init__(self)
self.set_four_vector([1, 0, 0, 1])
self._initial = initial
def __init__(self):
Player.__init__(self)
self.joss_instance = Joss()
def __init__(self, initial_plays=None):
Player.__init__(self)
if not initial_plays:
initial_plays = C + D
self.initial_plays = initial_plays
def __init__(self, lookup_table=None, initial_actions=None):
"""
If no lookup table is provided to the constructor, then use the TFT one.
"""
Player.__init__(self)
if not lookup_table:
lookup_table = {
('', 'C', 'D'): D,
('', 'D', 'D'): D,
('', 'C', 'C'): C,
('', 'D', 'C'): C,
}
self.lookup_table = lookup_table
# Rather than pass the number of previous turns (m) to consider in as a
# separate variable, figure it out. The number of turns is the length
# of the second element of any given key in the dict.
self.plays = len(list(self.lookup_table.keys())[0][1])
self.op_plays = len(list(self.lookup_table.keys())[0][2])
# The number of opponent starting actions is the length of the first
def __init__(self):
Player.__init__(self)
self.is_alt = False
def __init__(self, p=0.1):
"""
Parameters
----------
p, float
The probability to defect randomly
"""
Player.__init__(self)
self.p = p
if (self.p == 0) or (self.p == 1):
self.classifier['stochastic'] = False