How to use the axelrod.Player.__init__ function in Axelrod

To help you get started, we’ve selected a few Axelrod examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Axelrod-Python / Axelrod / axelrod / strategies / hunter.py View on Github external
def __init__(self):
        Player.__init__(self)
        self.cycle = None
github Axelrod-Python / Axelrod / axelrod / strategies / memoryone.py View on Github external
def __init__(self, initial=D):
        Player.__init__(self)
        self.set_four_vector([0, 1, 1, 0])
        self._initial = initial
github Axelrod-Python / Axelrod / axelrod / strategies / apavlov.py View on Github external
def __init__(self):
        Player.__init__(self)
        self.opponent_class = None
github Axelrod-Python / Axelrod / axelrod / strategies / memoryone.py View on Github external
def __init__(self, initial=C):
        Player.__init__(self)
        self.set_four_vector([1, 0, 0, 1])
        self._initial = initial
github Axelrod-Python / Axelrod / axelrod / strategies / calculator.py View on Github external
def __init__(self):
        Player.__init__(self)
        self.joss_instance = Joss()
github Axelrod-Python / Axelrod / axelrod / strategies / handshake.py View on Github external
def __init__(self, initial_plays=None):
        Player.__init__(self)
        if not initial_plays:
            initial_plays = C + D
        self.initial_plays = initial_plays
github Axelrod-Python / Axelrod / axelrod / strategies / lookerup.py View on Github external
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
github Axelrod-Python / Axelrod / axelrod / strategies / hunter.py View on Github external
def __init__(self):
        Player.__init__(self)
        self.is_alt = False
github Axelrod-Python / Axelrod / axelrod / strategies / naiveprober.py View on Github external
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