Skip to content
A repository used to reproduce Axelrod's tournament
Python
Branch: master
Clone or download
Pull request Compare This branch is 703 commits ahead, 5118 commits behind Axelrod-Python:master.
Latest commit e59fc40 Apr 16, 2015
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets Rerunning results Apr 16, 2015
axelrod
docs
.editorconfig
.gitignore
.travis.yml Adding strategies.py to .travis Apr 11, 2015
CHANGES.txt Trying to fix description on PyPi Apr 1, 2015
LICENSE.txt Moving files to be in line with Hitchikers guide Mar 29, 2015
MANIFEST.in Adding file to be in line with Hithcikers guide Mar 29, 2015
README.rst Resizing the image in the README Apr 10, 2015
cache.txt
requirements.txt Renaming file Mar 8, 2015
run_axelrod changes default repetitions to 10 Apr 16, 2015
setup.py Trying to fix description on PyPi Apr 1, 2015

README.rst

https://badge.waffle.io/Axelrod-Python/Axelrod.svg?label=ready&title=Ready https://travis-ci.org/Axelrod-Python/Axelrod.svg?branch=packaging

Join the chat at https://gitter.im/Axelrod-Python/Axelrod

Axelrod

A repository to reproduce Axelrod's iterated prisoner's dilemma. Please contribute strategies via pull request (or just get in touch with me).

For an overview of how to use and contribute to this repository, see the documentation: http://axelrod.readthedocs.org/

Installation

The simplest way to install is:

$ pip install axelrod

Here is an asciicast showing how to install and use the library:

https://asciinema.org/a/18590.png

Otherwise:

$ git clone https://github.com/Axelrod-Python/Axelrod.git
$ cd Axelrod
$ python setup.py install

Note that (as documented at http://axelrod.readthedocs.org/) you do not need to run the last step to use this package (you can run all the code from the root of the directory).

Results

This repository contains Python (2.7) code that reproduces the tournament. To run the tournament, you simply need to:

$ python run_tournament.py

This automatically outputs a png file with the results. You can see the results from the latest run of the tournament here:

As you can see: the 'tit for tat' strategy has not won in this instance, that is mainly because more strategies are needed to get anywhere near Axelrod's tournament.

You can see the results from the latest run of the tournament here with the cheating strategies (which manipulate/read what the opponent does):

Please do contribute :)

Note that you can run python run_tournament.py -h for further options available: for example, cheating strategies can be excluded for faster results by running:

$ python run_tournament.py --xc --xa

You can also run the tournament in parallel (below will run 4 parallel processes):

$ python run_tournament.py -p 4

You can run with all available CPUs with:

$ python run_tournament.py -p 0

Awesome visualisation

martinjc put together a pretty awesome visualisation of this using d3. Hosted on gh-pages it can be seen here: drvinceknight.github.io/Axelrod.

Documentation

There is currently a very sparse set of documentation up here: axelrod.readthedocs.org/.

To write/render the documenation locally, you will need sphinx:

$ pip install sphinx sphinx-autobuild

Once you have sphinx:

$ cd docs
$ make html

Contributing

All contributions are welcome: with a particular emphasis on contributing further strategies.

You can find helpful instructions about contributing in the documentation: http://axelrod.readthedocs.org/en/latest/contributing.html.

Contributors

You can’t perform that action at this time.