Skip to main content

A PettingZoo AECEnv implementation of the Fanorona board game.

Project description

Fanorona AEC Environment

PyPI v2.0.1 License: MIT Code style: black

  a b c d e f g h i
5 ●─●─●─●─●─●─●─●─●
  │╲│╱│╲│╱│╲│╱│╲│╱│
4 ●─●─●─●─●─●─●─●─●
  │╱│╲│╱│╲│╱│╲│╱│╲│
3 ●─○─●─○─·─●─○─●─○
  │╲│╱│╲│╱│╲│╱│╲│╱│
2 ○─○─○─○─○─○─○─○─○
  │╱│╲│╱│╲│╱│╲│╱│╲│
1 ○─○─○─○─○─○─○─○─○

This is an implementation of the Fanorona board game as a PettingZoo AEC game. The rules have been sourced from here. An additional rule where games exceeding $44$ moves end in a draw has been implemented, since the original rules do not have explicit draw conditions.

Installation

Using pip (recommended)

python -m pip install fanorona-aec

Local

git clone https://github.com/AbhijeetKrishnan/fanorona-aec.git
cd fanorona-aec
python -m pip install .

Usage

Setting up a basic environment

In a Python shell, run the following:

import fanorona_aec
env = fanorona_v2.env()

See demo.py for a script that implements a simple random policy to interact with the environment.

Testing

We use pytest for tests. You can run them via:

git clone https://github.com/AbhijeetKrishnan/fanorona-aec.git
cd fanorona-aec
python -m pip install .[dev]
pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fanorona-aec-2.0.1.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

fanorona_aec-2.0.1-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file fanorona-aec-2.0.1.tar.gz.

File metadata

  • Download URL: fanorona-aec-2.0.1.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for fanorona-aec-2.0.1.tar.gz
Algorithm Hash digest
SHA256 242c0f1f2d23d63deef886bbb29e105e3f6e96d39c7d323d424a1aee216e2c85
MD5 8d2be800d74466af92394c538077bbef
BLAKE2b-256 a03e414a2a60e2fea42cdb34314374e7d6f1114a2b321b0ef1b9de1f3b4f7f53

See more details on using hashes here.

File details

Details for the file fanorona_aec-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: fanorona_aec-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for fanorona_aec-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 613b35b2c079bc7e57fb7a4c18fb151e077c39bbbb3dd3a229a48e476fdb9483
MD5 81c5922d830e779961e80f91d0662e16
BLAKE2b-256 7279fcf521e054003b8373e5d2cb1d2e0904010c229798b4810ce06a551a2eaa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page