Run OpenAI Gym environments on an external process or remote machine using gRPC.
Install Gym (not required if using Docker) and run:
pip install gymxIt is recommended to use a virtual environment.
To start the server run:
python -m gymxTo use a different port run:
python -m gymx --port=54321You can also run the server using Docker:
docker run -p 54321:54321 album/gymxInside your application use:
from gymx import Env
env = Env('CartPole-v0')To specify the server address use:
env = Env('CartPole-v0', address='localhost:54321')env.reset(): Reset the environment's state. Returnsobservation.env.step(action): Step the environment by one timestep. Returnsobservation,reward,done,next_episode. Unlike the original gym API, it automatically resets the environment when done and returns next episode's observation instead ofinfo.