A research tool for the Iterated Prisoner's Dilemma
.. image:: https://img.shields.io/pypi/v/Axelrod.svg :target: https://pypi.python.org/pypi/Axelrod
.. image:: https://zenodo.org/badge/19509/Axelrod-Python/Axelrod.svg :target: https://zenodo.org/badge/latestdoi/19509/Axelrod-Python/Axelrod
.. image:: https://github.com/Axelrod-Python/Axelrod/workflows/CI/badge.svg :target: https://github.com/Axelrod-Python/Axelrod/actions
|Join the chat at https://gitter.im/Axelrod-Python/Axelrod|
A Python library with the following principles and goals:
With Axelrod you:
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.
head to head matches_ between pairs of strategies.
tournaments_ over a number of strategies.
Moran processes_ and an
infinite population model_.
results of tournaments_ and matches.
visualise results_ of tournaments.
.. image:: http://axelrod.readthedocs.io/en/stable/images/demostrategies_boxplot.svg :height: 300 px :align: center
fingerprinting_ of strategies and
.. image:: https://github.com/Axelrod-Python/Axelrod-fingerprint/raw/master/assets/Tricky_Defector.png :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: http://axelrod.readthedocs.org/
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.6 or greater.
The simplest way to install is::
$ pip install axelrod
To install from source::
$ git clone https://github.com/Axelrod-Python/Axelrod.git $ cd Axelrod $ python setup.py install
The following runs a basic tournament::
>>> import axelrod as axl >>> players = [s() for s in axl.demo_strategies] # Create players >>> tournament = axl.Tournament(players, seed=1) # Create a tournament >>> results = tournament.play() # Play the tournament >>> results.ranked_names ['Defector', 'Grudger', 'Tit For Tat', 'Cooperator', 'Random: 0.5']
All contributions are welcome!
You can find helpful instructions about contributing in the documentation: http://axelrod.readthedocs.org/en/latest/tutorials/contributing/index.html
You can find a list of publications that make use of or cite the library on the
The library has had many awesome contributions from many
great contributors_. The Core developers of the project are:
.. |Join the chat at https://gitter.im/Axelrod-Python/Axelrod| image:: https://badges.gitter.im/Join%20Chat.svg :target: https://gitter.im/Axelrod-Python/Axelrod?utmsource=badge&utmmedium=badge&utmcampaign=pr-badge&utmcontent=badge