https://github.com/vivek3141/snake-gym
A gym environment for the game snake, with a tiled version. Contains implementations for NEAT and RL.
https://github.com/vivek3141/snake-gym
deep-q-network dopamine dopamine-rl reinforcement-learning snake snake-ai
Last synced: 2 months ago
JSON representation
A gym environment for the game snake, with a tiled version. Contains implementations for NEAT and RL.
- Host: GitHub
- URL: https://github.com/vivek3141/snake-gym
- Owner: vivek3141
- License: mit
- Created: 2018-09-09T07:18:37.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-30T22:14:37.000Z (about 5 years ago)
- Last Synced: 2024-10-03T01:43:25.964Z (8 months ago)
- Topics: deep-q-network, dopamine, dopamine-rl, reinforcement-learning, snake, snake-ai
- Language: Python
- Homepage: https://pypi.org/project/snake-gym/
- Size: 793 KB
- Stars: 9
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Snake-Gym
[](https://pepy.tech/project/snake-gym)
[](https://pypi.python.org/pypi/snake-gym)
[](https://pypi.python.org/pypi/snake-gym)
[](https://pypi.python.org/pypi/snake-gym)Contains a gym environment for the classic game snake.
## Implementing
* `env.render()` is not implemented, running it will raise `NotImplementedError`.
* `env.reset()` opens the GUI for the game.
* `env.fps` contains the fps to run the game at. You can set it using:
```python
env.fps = 60
```
## Installation
For the latest installation, run
```bash
git clone https://github.com/vivek3141/snake-gym
pip install -e .
```
You can install the latest release by
```bash
pip install snake-gym
```## Creating The Environment
The environment can be created by doing the following:
```python
import gym
import snake_gym
env = gym.make("snake-v0")
```## Environments
* `snake-v0` Returns a 150x150 RGB image in the form of a numpy array for the observations
* `snake-tiled-v0` Returns a 10x10 matrix for the observations.
* `0` is empty space
* `1` is the snake
* `2` is the food