Skip to main content

Gym PyColab

gym interface for pycolab games.


Extraterrestrial Marauders

Extraterrestrial Marauders

$ pip install gym-pycolab

API

Example

Inherit from gym_pycolab.PyColabEnv to make a gym.Env version. Also see pycolab_games.py for more examples.

import gym_pycolab
from gym import spaces

class MyGameEnv(gym_pycolab.PyColabEnv):
    """A pycolab game env."""

    def __init__(self,
                 max_iterations=10,
                 default_reward=-1.):
        super(MyGameEnv, self).__init__(
            max_iterations=max_iterations,
            default_reward=default_reward,
            action_space=spaces.Discrete(4))

    def make_game(self):
        return my_game

    def make_colors(self):
        return {'#': (0, 0, 255)}

env = MyGameEnv()
state = env.reset()
state, reward, done, info = env.step(0)

Games and Envs

Includes most of the pycolab example games (with gym.make(game) or gym_pycolab.{game}Env(...)):

Running an Example

Rendering the ExtraterrestrialMarauders-v0 with random actions:

$ python -m gym_pycolab.pycolab_games --game extraterrestrial_marauders

Development

Development is started with pipenv.

$ pipenv install
$ pipenv shell

Testing

$ python -m gym_pycolab.pycolab_env_test

Release files for gym-pycolab 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gym-pycolab 1.0.0
File Size Uploaded
gym-pycolab-1.0.0.tar.gz 6.9 kB Details

Release files / gym-pycolab-1.0.0.tar.gz

Download URL gym-pycolab-1.0.0.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
98c62924f4b08cb1e2325a4c17d77a4d5c4ded5e8736ca18307911f006ee37f9
BLAKE2b-256 checksum
How to use checksums
a58b9b575079e358a0b92fb9d9ac2bc0d42cbcace96d9dff50cb94490a665881
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.5

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page