# Glossary¶

There are a variety of terms used in the documentation and throughout the library. Here is an overview:

## An action¶

An **action** is either `C`

or `D`

.
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¶

A **play** is a single player choosing an **action**.
In terms of code this is equivalent to:

```
>>> p1, p2 = axl.Cooperator(), axl.Defector()
>>> (C, D) = p1.play(p2) # This constitues two 'plays' (p1 plays and p2 plays).
```

This is equivalent to `p2.play(p1)`

. Either function invokes both
`p1.strategy(p2)`

and `p2.strategy(p1)`

.

## A turn¶

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: `(C, C)`

, `(C, D)`

,
`(D, C)`

, or `(D, D)`

.

## A match¶

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
3 turns:

```
>>> p1, p2 = axl.Cooperator(), axl.Defector()
>>> for turn in range(3):
... p1.play(p2)
(C, D)
(C, D)
(C, D)
>>> p1.history, p2.history
([C, C, C], [D, D, D])
```

## A win¶

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¶

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¶

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¶

A **tournament** is a repetition of round robins so as to smooth out stochastic effects.

## Noise¶

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.