Skip to content

ice-2022/remote-gym-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

remote-gym-proxy

Install

git clone [email protected]:ice-2022/remote-gym-proxy.git
cd remote-gym-proxy
python setup.py install

Server-Demo

give gym.Env through GymProxy.create_env_custom, and give GymServer, the server is finish!

import gym
from remote_gym_proxy.core import GymServer
from remote_gym_proxy.core import GymProxy


class CartPoleV0Proxy(GymProxy):
    def create_env_custom(self):
        env = gym.make('CartPole-v0')
        return env


cart_proxy = CartPoleV0Proxy()
gym_server = GymServer(address="127.0.0.1", port=9527, gym_proxy=cart_proxy)
gym_server.start()

Client-Demo

from remote_gym_proxy.core import RemoteEnv
import numpy as np

env = RemoteEnv(address="127.0.0.1", port=9527)
print("env:")
print("action: ", env.action_space)
print("observation_space: ", env.observation_space)
print("-" * 20)
print("reset")
print("observation:", env.reset())
print("-" * 20)
print("step1")
print("result1:", env.step(np.int32(env.action_space.sample())))
print("-" * 20)
print("step2")
print("result2:", env.step(np.int32(env.action_space.sample())))
print("-" * 20)
env.close()

Client-Demo with training

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages