Axelrod

by Axelrod-Python

Axelrod-Python / Axelrod

A research tool for the Iterated Prisoner's Dilemma

492 Stars 183 Forks Last release: 3 months ago (v4.10.0) Other 5.5K Commits 94 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

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

Axelrod

Goals

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

Features

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:: 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 
    _ of strategies and
    morality metrics
    
    _.

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

Installation

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

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 strategies in the repository against each other. These results can be easily viewed at http://axelrod-tournament.readthedocs.org.
  • https://github.com/Axelrod-Python/Axelrod-notebooks contains a set of example Jupyter notebooks.
  • https://github.com/Axelrod-Python/Axelrod-fingerprint contains fingerprints (data and plots) of all strategies in the library.

Contributing

All contributions are welcome!

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

Publications

You can find a list of publications that make use of or cite the library on the

citations 
_ page.

Contributors

The library has had many awesome contributions from many

great
contributors 
_. The Core developers of the project are:
  • drvinceknight 
    _
  • gaffney2010 
    _
  • marcharper 
    _
  • meatballs 
    _
  • nikoleta-v3 
    _

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

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.