fanorona-aec


Namefanorona-aec JSON
Version 3.0.2 PyPI version JSON
download
home_page
SummaryA PettingZoo AECEnv implementation of the Fanorona board game.
upload_time2023-12-12 22:31:38
maintainer
docs_urlNone
author
requires_python>=3.10
licenseCopyright (c) 2023 Abhijeet Krishnan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords
VCS
bugtrack_url
requirements pettingzoo
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Fanorona AEC Environment

[![PyPI v3.0.2](https://img.shields.io/pypi/v/fanorona-aec)](https://pypi.org/project/fanorona-aec/3.0.2/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)


```
  A B C D E F G H I
5 ●─●─●─●─●─●─●─●─●
  │╲│╱│╲│╱│╲│╱│╲│╱│
4 ●─●─●─●─●─●─●─●─●
  │╱│╲│╱│╲│╱│╲│╱│╲│
3 ●─○─●─.─○─.─○─●─○
  │╲│╱│╲│╱│╲│╱│╲│╱│
2 ○─○─○─○─○─○─○─○─○
  │╱│╲│╱│╲│╱│╲│╱│╲│
1 ○─○─○─○─○─○─○─○─○

W to play
Last capture: E3 E
Visited: D3, E3
Half-moves: 0
```

This is an implementation of the Fanorona board game as a [PettingZoo](https://github.com/PettingZoo-Team/PettingZoo) [AEC](https://arxiv.org/abs/2009.13051) game.
The rules have been sourced from [here](https://www.mindsports.nl/index.php/the-pit/528-fanorona).
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)

```bash
python -m pip install fanorona-aec
```

### Local

```bash
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:

```python
from fanorona_aec import fanorona_v3
env = fanorona_v3.env()
```

See [`demo.py`](./demo.py) for a script that implements a simple random policy to interact with the environment.

## Testing

We use [pytest](http://doc.pytest.org/) for tests. You can run them via:

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

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "fanorona-aec",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "Abhijeet Krishnan <abhijeet.krishnan@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/aa/43/80303d8956370d9d0534b6ba76a7cf77233b0093d67dbfb327729c244296/fanorona-aec-3.0.2.tar.gz",
    "platform": null,
    "description": "# Fanorona AEC Environment\n\n[![PyPI v3.0.2](https://img.shields.io/pypi/v/fanorona-aec)](https://pypi.org/project/fanorona-aec/3.0.2/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)\n\n\n```\n  A B C D E F G H I\n5 \u25cf\u2500\u25cf\u2500\u25cf\u2500\u25cf\u2500\u25cf\u2500\u25cf\u2500\u25cf\u2500\u25cf\u2500\u25cf\n  \u2502\u2572\u2502\u2571\u2502\u2572\u2502\u2571\u2502\u2572\u2502\u2571\u2502\u2572\u2502\u2571\u2502\n4 \u25cf\u2500\u25cf\u2500\u25cf\u2500\u25cf\u2500\u25cf\u2500\u25cf\u2500\u25cf\u2500\u25cf\u2500\u25cf\n  \u2502\u2571\u2502\u2572\u2502\u2571\u2502\u2572\u2502\u2571\u2502\u2572\u2502\u2571\u2502\u2572\u2502\n3 \u25cf\u2500\u25cb\u2500\u25cf\u2500.\u2500\u25cb\u2500.\u2500\u25cb\u2500\u25cf\u2500\u25cb\n  \u2502\u2572\u2502\u2571\u2502\u2572\u2502\u2571\u2502\u2572\u2502\u2571\u2502\u2572\u2502\u2571\u2502\n2 \u25cb\u2500\u25cb\u2500\u25cb\u2500\u25cb\u2500\u25cb\u2500\u25cb\u2500\u25cb\u2500\u25cb\u2500\u25cb\n  \u2502\u2571\u2502\u2572\u2502\u2571\u2502\u2572\u2502\u2571\u2502\u2572\u2502\u2571\u2502\u2572\u2502\n1 \u25cb\u2500\u25cb\u2500\u25cb\u2500\u25cb\u2500\u25cb\u2500\u25cb\u2500\u25cb\u2500\u25cb\u2500\u25cb\n\nW to play\nLast capture: E3 E\nVisited: D3, E3\nHalf-moves: 0\n```\n\nThis is an implementation of the Fanorona board game as a [PettingZoo](https://github.com/PettingZoo-Team/PettingZoo) [AEC](https://arxiv.org/abs/2009.13051) game.\nThe rules have been sourced from [here](https://www.mindsports.nl/index.php/the-pit/528-fanorona).\nAn additional rule where games exceeding $44$ moves end in a draw has been implemented, since the\noriginal rules do not have explicit draw conditions.\n\n## Installation\n\n### Using pip (recommended)\n\n```bash\npython -m pip install fanorona-aec\n```\n\n### Local\n\n```bash\ngit clone https://github.com/AbhijeetKrishnan/fanorona-aec.git\ncd fanorona-aec\npython -m pip install .\n```\n\n## Usage\n\n### Setting up a basic environment\n\nIn a Python shell, run the following:\n\n```python\nfrom fanorona_aec import fanorona_v3\nenv = fanorona_v3.env()\n```\n\nSee [`demo.py`](./demo.py) for a script that implements a simple random policy to interact with the environment.\n\n## Testing\n\nWe use [pytest](http://doc.pytest.org/) for tests. You can run them via:\n\n```bash\ngit clone https://github.com/AbhijeetKrishnan/fanorona-aec.git\ncd fanorona-aec\npython -m pip install .[dev]\npytest\n```\n",
    "bugtrack_url": null,
    "license": "Copyright (c) 2023 Abhijeet Krishnan  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A PettingZoo AECEnv implementation of the Fanorona board game.",
    "version": "3.0.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/AbhijeetKrishnan/fanorona-aec/issues",
        "Repository": "https://github.com/AbhijeetKrishnan/fanorona-aec"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "48c7513d5d697e3c7f363580ac23a51a72a9f7bce996a5d65add96be28ec743a",
                "md5": "64a741f10bb39288ed8f54242d19aff8",
                "sha256": "7671f4de2bd51bf12234c70db42c25929446dd65222b15d26d00e83737fbe2a4"
            },
            "downloads": -1,
            "filename": "fanorona_aec-3.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "64a741f10bb39288ed8f54242d19aff8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 16459,
            "upload_time": "2023-12-12T22:31:34",
            "upload_time_iso_8601": "2023-12-12T22:31:34.825817Z",
            "url": "https://files.pythonhosted.org/packages/48/c7/513d5d697e3c7f363580ac23a51a72a9f7bce996a5d65add96be28ec743a/fanorona_aec-3.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aa4380303d8956370d9d0534b6ba76a7cf77233b0093d67dbfb327729c244296",
                "md5": "ae9be94c6d32cebf6b9ea416ca7ada67",
                "sha256": "5ac851d673dd9d7271da18945c4fac5091c68ece16f590f05d18a3dbcf8e399a"
            },
            "downloads": -1,
            "filename": "fanorona-aec-3.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "ae9be94c6d32cebf6b9ea416ca7ada67",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 19559,
            "upload_time": "2023-12-12T22:31:38",
            "upload_time_iso_8601": "2023-12-12T22:31:38.612136Z",
            "url": "https://files.pythonhosted.org/packages/aa/43/80303d8956370d9d0534b6ba76a7cf77233b0093d67dbfb327729c244296/fanorona-aec-3.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-12 22:31:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "AbhijeetKrishnan",
    "github_project": "fanorona-aec",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "pettingzoo",
            "specs": []
        }
    ],
    "lcname": "fanorona-aec"
}
        
Elapsed time: 0.16638s