Skip to main content

Gym environment for Snake

Project description

Snake AI

Contains a gym environment for the classic game snake.
Implementation for the NEAT algorithm and RL agents can be found in examples/

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:
    env.fps = 60
    

Installation

For the latest installation, run

git clone https://github.com/vivek3141/snake-ai
pip install -e .

You can install the latest release by

pip install snake_gym

Creating The Environment

The environment can be created by doing the following:

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

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snake_gym-1.2-py3-none-any.whl (1.6 kB view details)

Uploaded Python 3

File details

Details for the file snake_gym-1.2-py3-none-any.whl.

File metadata

  • Download URL: snake_gym-1.2-py3-none-any.whl
  • Upload date:
  • Size: 1.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for snake_gym-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 190ab97cb6a0068211cc2050cdbe5eb60ef1ff6aed27d152a99abad10cee75c0
MD5 5f7cf046b2697c2d14a7e5efad242679
BLAKE2b-256 6d83dc86105652bbd82ad671d288ab8eb673d4349577c2680fa4468414f18ea1

See more details on using hashes here.

Supported by

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