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 Game Theory Discord <https://github.com/drvinceknight/equilibriumexplorers> server to chat -- direct invite link <https://discord.gg/NfTAkhAeyc>_.
Axelrod =======
Goals
A Python library with the following principles and goals:
- Enabling the reproduction of previous Iterated Prisoner's Dilemma research
- Creating the de-facto tool for future Iterated Prisoner's Dilemma
- Providing as simple a means as possible for anyone to define and contribute
- Emphasizing readability along with an open and welcoming community that
Features
With Axelrod you:
- have access
to over 200 strategies
- can create
head to head matches
- can create
tournaments
- can study population dynamics through
Moran processes
infinite
population model
<https://axelrod.readthedocs.io/en/stable/how-to/runaxelrodsecologicalvariant.html>.
- can analyse detailed
results of tournaments
- can
visualise results
.. image:: http://axelrod.readthedocs.io/en/stable/images/demostrategies_boxplot.svg :height: 300 px :align: center
- can reproduce a number of contemporary research topics such as
fingerprinting <https://axelrod.readthedocs.io/en/stable/how-to/fingerprint.html>_ of
morality metrics
<https://axelrod.readthedocs.io/en/stable/how-to/calculatemoralitymetrics.html>_.
.. 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 <http://openresearchsoftware.metajnl.com/article/10.5334/jors.125/>_: a peer reviewed paper introducing the library (22 authors).
Installation
The library is tested on Python versions 3.8, 3.9, and 3.10.
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
Quick Start
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']
Examples
- https://github.com/Axelrod-Python/tournament is a tournament pitting all the
- https://github.com/Axelrod-Python/Axelrod-notebooks contains a set of example
- https://github.com/Axelrod-Python/Axelrod-fingerprint contains fingerprints
Contributing
All artisanal contributions are welcome!
Code Generation Policy:
We do not accept any content that has been created with the assistance of generative code tools.
You can find helpful instructions about contributing in the documentation: https://axelrod.readthedocs.io/en/stable/how-to/contributing/index.html
Publications
You can find a list of publications that make use of or cite the library on the citations <https://github.com/Axelrod-Python/Axelrod/blob/master/citations.md>_ page.
Contributors
The library has had many awesome contributions from many great contributors <https://github.com/Axelrod-Python/Axelrod/graphs/contributors>_. The Core developers of the project are:
drvinceknight <https://github.com/drvinceknight>_gaffney2010 <https://github.com/gaffney2010>_marcharper <https://github.com/marcharper>_meatballs <https://github.com/meatballs>_nikoleta-v3 <https://github.com/Nikoleta-v3>_