Status: Active (under active development, breaking changes may occur)
A grid-based environment for single agent systems based on openAI-gym.
Installation
pip3 install -i https://test.pypi.org/simple/ Gridworld==0.0.1
Alternative installation
cd $HOME
git clone https://github.com/addy1997/Gridworld.git
cd Gridworld
virtualenv venv
source ./venv/bin/activate
pip install -e .
Note: you will get this message after installation(given below). This validates that the package installation is done properly.
For errors
Visit this link
You do not need to modify baselines repo.
Here is a minimal example. Say you have myenv.py, with all the needed functions (step, reset, ...). The name of the class environment is MyEnv, and you want to add it to the classic_control folder. You have to follow these steps
* Place myenv.py file in gym/gym/envs/classic_control
* Add to __init__.py (located in the same folder)
* from gym.envs.classic_control.myenv import MyEnv
* Register the environment in gym/gym/envs/__init__.py by adding
gym.envs.register(
id='MyEnv-v0',
entry_point='gym.envs.classic_control:MyEnv',
max_episode_steps=1000,
)
_At registration, you can also add reward_threshold and kwargs (if your class takes some arguments). You can also directly register the environment in the script you will run (TRPO, PPO, or whatever) instead of doing it _
in gym/gym/envs/init.py.
Testing
import Gridworld
import gym
env = gym.make('Grid-v0')
Feel free to raise an issue for errors.