Skip to content

Axelrod-Python/Axelrod

Folders and files

NameName
Last commit message
Last commit date
May 8, 2024
Feb 3, 2025
Feb 3, 2025
Apr 12, 2020
Mar 10, 2015
Dec 15, 2015
Jul 5, 2020
Sep 9, 2020
Oct 15, 2015
Sep 9, 2020
May 17, 2023
Oct 2, 2024
Jan 10, 2023
Apr 11, 2017
Aug 23, 2021
Jun 4, 2016
Apr 8, 2020
Nov 10, 2024
Jan 10, 2025
Sep 9, 2020
Aug 16, 2018
Jul 11, 2024
Mar 27, 2020
Feb 3, 2025
May 8, 2024
Sep 9, 2016
Feb 3, 2023
May 8, 2016
Jan 13, 2025

Repository files navigation

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:

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

Contributing

All contributions are welcome!

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

Contributors

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