A PettingZoo AECEnv implementation of the Fanorona board game.
Project description
Fanorona AEC Environment
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 hashes)
Built Distribution
Close
Hashes for fanorona_aec-2.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 613b35b2c079bc7e57fb7a4c18fb151e077c39bbbb3dd3a229a48e476fdb9483 |
|
MD5 | 81c5922d830e779961e80f91d0662e16 |
|
BLAKE2b-256 | 7279fcf521e054003b8373e5d2cb1d2e0904010c229798b4810ce06a551a2eaa |