There are a variety of terms used in the documentation and throughout the library. Here is an overview:
An action is either
You can access these actions as follows but should not really have a reason to:
>>> import axelrod as axl >>> axl.Action.C C >>> axl.Action.D D
A play is a single player choosing an action. In terms of code this is equivalent to:
>>> p1, p2 = axl.Cooperator(), axl.Defector() >>> p1.play(p2) # This constitues two 'plays' (p1 plays and p2 plays).
This is equivalent to
p2.play(p1). Either function invokes both
A turn is a 1 shot interaction between two players. It is in effect a composition of two plays.
Each turn has four possible outcomes of a play:
(D, C), or
A match is a consecutive number of turns. The default number of turns used in the tournament is 200. Here is a single match between two players over 10 turns:
>>> p1, p2 = axl.Cooperator(), axl.Defector() >>> for turn in range(10): ... p1.play(p2) >>> p1.history, p2.history ([C, C, C, C, C, C, C, C, C, C], [D, D, D, D, D, D, D, D, D, D])
A win is attributed to the player who has the higher total score at the end
of a match. For the example above,
Defector would win that match.
A strategy is a set of instructions that dictate how to play given one’s own strategy and the strategy of an opponent. In the library these correspond to the strategy classes: TitForTat, Grudger, Cooperator etc…
When appropriate to do so this will be used interchangeable with A player.
A player is a single agent using a given strategy. Players are the participants of tournament, usually they each represent one strategy but of course you can have multiple players choosing the same strategy. In the library these correspond to __instances__ of classes:
>>> p1, p2 = axl.Cooperator(), axl.Defector() >>> p1 Cooperator >>> p2 Defector
When appropriate to do so this will be used interchangeable with A strategy.
A round robin¶
A round robin is the set of all potential (order invariant) matches between a given collection of players.
A tournament is a repetition of round robins so as to smooth out stochastic effects.
A match or tournament can be played with noise: this is the probability that indicates the chance of an action dictated by a strategy being swapped.