Gym PyColab
gym
interface for pycolab
games.
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(...)
):
-
Ordeal-v0
(ordeal) -
WarehouseManager-v{0,1,2}
(warehouse_manager) -
FluvialNatation-v0
(fluvial_natation) -
ExtraterrestrialMarauders-v0
(extraterrestrial_marauders) -
ShockWave-v{0,1}
(shockwave) -
Aperture-v{0,1,2}
(aperture) -
Apprehend-v0
(apprehend) -
BetterScrollyMaze-v{0,1,2}
(better_scrolly_maze) -
ChainWalk-v0
(classics/chain_walk) -
CliffWalk-v0
(classics/cliff_walk) -
FourRooms-v0
(classics/four_rooms)
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