Skip to main content

Reproduce the Axelrod iterated prisoners dilemma tournament

Project description

.. image::

.. image::

.. image::

.. image::

|Join the chat at|



A Python library with the following principles and goals:

1. Enabling the reproduction of previous Iterated Prisoner's Dilemma research
as easily as possible.
2. Creating the de-facto tool for future Iterated Prisoner's Dilemma
3. Providing as simple a means as possible for anyone to define and contribute
new and original Iterated Prisoner's Dilemma strategies.
4. Emphasizing readability along with an open and welcoming community that
is accommodating for developers and researchers of a variety of skill levels.


With Axelrod you:

- have access `to over 200 strategies
<>`_, including original and classics like Tit
For Tat and Win Stay Lose Shift. These are extendable through parametrization
and a collection of strategy transformers.
- can create `head to head matches
<>`_ between pairs of strategies.
- can create `tournaments
<>`_ over a number of strategies.
- can study population dynamics through `Moran processes
<>`_ and an `infinite
population model
- can analyse detailed `results of tournaments
<>`_ and matches.
- can `visualise results
<>`_ of tournaments.

.. image::
:height: 300 px
:align: center

- can reproduce a number of contemporary research topics such as `fingerprinting <>`_ of
strategies and `morality metrics

.. image::
:height: 300 px
:align: center

The library has 100% test coverage and is extensively documented. See the
documentation for details and examples of all the features:

`An open reproducible framework for the study of the iterated prisoner's
dilemma <>`_:
a peer reviewed paper introducing the library (22 authors).


The library requires Python 3.5 or greater.

The simplest way to install is::

$ pip install axelrod

To install from source::

$ git clone
$ cd Axelrod
$ python install

Quick Start

The following runs a basic tournament::

>>> import axelrod as axl
>>> axl.seed(0) # Set a seed
>>> players = [s() for s in axl.demo_strategies] # Create players
>>> tournament = axl.Tournament(players) # Create a tournament
>>> results = # Play the tournament
>>> results.ranked_names
['Defector', 'Grudger', 'Tit For Tat', 'Cooperator', 'Random: 0.5']


- is a tournament pitting all the
strategies in the repository against each other. These results can be easily
viewed at
- contains a set of example
Jupyter notebooks.
- contains fingerprints
(data and plots) of all strategies in the library.


All contributions are welcome!

You can find helpful instructions about contributing in the


* Marc Harper, Vincent Knight, Martin Jones, Georgios Koutsovoulos, Nikoleta E. Glynatsi, Owen Campbell. `Reinforcement learning produces dominant strategies for the Iterated Prisoner’s Dilemma. <>`_ Plos One (2017). (`ArXiv Preprint <>`_)
* Vincent Knight, Owen Campbell, Marc Harper, Karol Langner et al. `An Open Framework for the Reproducible Study of the Iterated Prisoner’s Dilemma. <>`_ Journal of Open Research Software 4, no. 1 (2016). (`ArXiv Preprint <>`_)


The library has had many awesome contributions from many `great
contributors <>`_.
The Core developers of the project are:

- `drvinceknight <>`_
- `marcharper <>`_
- `meatballs <>`_

.. |Join the chat at| image::

Project details

Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
Axelrod-4.3.0-py2.py3-none-any.whl (162.3 kB) Copy SHA256 hash SHA256 Wheel 3.6 Aug 30, 2018
Axelrod-4.3.0.tar.gz (170.3 kB) Copy SHA256 hash SHA256 Source None Aug 30, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page