Module Import alias ImportFrom alias alias ImportFrom alias ClassDef bases NameLoad body Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body If AttributeLoad NameLoad attr body Assign NameStore ListLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr orelse Assign NameStore NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args defaults body Raise Call NameLoad decorator_list FunctionDef arguments args defaults body Raise Call NameLoad decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults Num body Expr Str For NameStore Call NameLoad Call NameLoad AttributeLoad NameLoad attr body For NameStore Call NameLoad NameLoad Call NameLoad AttributeLoad NameLoad attr body Assign NameStore TupleLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Yield TupleLoad TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num body Expr Str Return Call NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad keyword Call NameLoad Str keyword NameLoad keyword NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num body Expr Str Return Call NameLoad NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr Return Call NameLoad Call NameLoad BinOpDiv Call NameLoad BinOpSub Num NameLoad Call NameLoad BinOpSub Num AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Return Call NameLoad Str ExceptHandler type NameLoad body Return Num decorator_list decorator_list
N/A N/A random math ceil log match Match MatchGenerator N/A object N/A N/A clone_opponents True __init__ N/A N/A self players turns game deterministic_cache N/A N/A N/A 
        A class to generate matches. This is used by the Tournament class which
        is in charge of playing the matches and collecting the results.

        Parameters
        ----------
        players : list
            A list of axelrod.Player objects
        turns : integer
            The number of turns per match
        game : axelrod.Game
            The game object used to score the match
        deterministic_cache : an instance of axelrod.DeterministicCache
        class
            A cache of resulting actions for deterministic matches
         N/A N/A self players players N/A N/A self turns turns N/A N/A self game game N/A N/A self deterministic_cache deterministic_cache N/A N/A self opponents players N/A opponents N/A N/A self N/A N/A N/A N/A self _opponents N/A property opponents N/A N/A self players N/A N/A N/A N/A self clone_opponents N/A N/A opponents N/A N/A player players N/A N/A N/A N/A opponents append N/A N/A player clone N/A N/A opponents players N/A N/A self _opponents opponents N/A N/A opponents setter build_matches N/A N/A N/A N/A N/A N/A NotImplementedError N/A build_single_match N/A N/A N/A N/A N/A N/A NotImplementedError N/A N/A RoundRobinMatches N/A MatchGenerator N/A N/A clone_opponents True build_matches N/A N/A self noise N/A 0 N/A N/A 
        A generator that returns player index pairs and match objects for a
        round robin tournament.

        Parameters
        ----------
        noise : float
            The probability that a player's intended action should be flipped

        Yields
        -------
        tuple
            player pair index, match object
         N/A player1_index N/A range N/A len N/A self players N/A N/A player2_index N/A range player1_index N/A len N/A self players N/A N/A pair N/A N/A N/A self players N/A player1_index N/A N/A self opponents N/A player2_index N/A match N/A N/A self build_single_match pair noise N/A N/A N/A N/A player1_index player2_index match N/A build_single_match N/A N/A self pair noise N/A 0 N/A N/A Create a single match for a given pair N/A N/A Match pair N/A self turns N/A self game N/A self deterministic_cache noise N/A N/A ProbEndRoundRobinMatches N/A RoundRobinMatches N/A N/A clone_opponents True __init__ N/A N/A self players prob_end game deterministic_cache N/A N/A N/A 
        A class that generates matches for which the players do not
        know the length of the Match (to their knowledge it is infinite) but
        that ends with given probability.

        Parameters
        ----------
        players : list
            A list of axelrod.Player objects
        prob_end : float
            The probability that a turn of a Match is the last
        game : axelrod.Game
            The game object used to score the match
        deterministic_cache : an instance of axelrod.DeterministicCache
            A cache of resulting actions for deterministic matches
         N/A N/A N/A N/A super ProbEndRoundRobinMatches self __init__ players turns N/A float inf game game deterministic_cache deterministic_cache N/A N/A self prob_end prob_end N/A build_single_match N/A N/A self pair noise N/A 0 N/A N/A Create a single match for a given pair N/A N/A Match pair N/A N/A self sample_length N/A self prob_end N/A self game N/A self deterministic_cache noise N/A sample_length N/A N/A self prob_end N/A N/A N/A 
        Sample length of a game.

        This is using inverse random sample on a probability density function
        <https://en.wikipedia.org/wiki/Probability_density_function> given by:

        f(n) = p_end * (1 - p_end) ^ (n - 1)

        (So the probability of length n is given by f(n))

        Which gives cumulative distribution function
        <https://en.wikipedia.org/wiki/Cumulative_distribution_function>:

        F(n) = 1 - (1 - p_end) ^ n

        (So the probability of length less than or equal to n is given by F(n))

        Which gives for given x = F(n) (ie the random sample) gives n:

        n = ceil((ln(1-x)/ln(1-p_end)))

        This approach of sampling from a distribution is called inverse
        transform sampling
        <https://en.wikipedia.org/wiki/Inverse_transform_sampling>.

        Note that this corresponds to sampling at the end of every turn whether
        or not the Match ends.
         N/A N/A N/A x N/A N/A random random N/A N/A int N/A ceil N/A N/A log N/A 1 x N/A log N/A 1 N/A self prob_end N/A N/A N/A ZeroDivisionError N/A N/A N/A float inf N/A N/A ValueError N/A N/A 1 N/A N/A