From 9a87c6fcef64d95f0d4b3c7f2df411eff2dc2990 Mon Sep 17 00:00:00 2001 From: Nicolai Czempin Date: Fri, 31 Mar 2017 00:38:15 +0200 Subject: [PATCH] add initial Python files --- gym_random_walk/__init__.py | 10 ++++++++++ gym_random_walk/envs/__init__.py | 1 + gym_random_walk/envs/random_walk_py | 15 +++++++++++++++ setup.py | 7 +++++++ 4 files changed, 33 insertions(+) create mode 100644 gym_random_walk/__init__.py create mode 100644 gym_random_walk/envs/__init__.py create mode 100644 gym_random_walk/envs/random_walk_py create mode 100644 setup.py diff --git a/gym_random_walk/__init__.py b/gym_random_walk/__init__.py new file mode 100644 index 0000000..44ebf7e --- /dev/null +++ b/gym_random_walk/__init__.py @@ -0,0 +1,10 @@ +from gym.envs.registration import register + +register( + id='random_walk-v0', + entry_point='gym_random_walk.envs:RandomWalkEnv', +) +#register( +# id='foo-extrahard-v0', +# entry_point='gym_foo.envs:FooExtraHardEnv', +#) diff --git a/gym_random_walk/envs/__init__.py b/gym_random_walk/envs/__init__.py new file mode 100644 index 0000000..57a7dca --- /dev/null +++ b/gym_random_walk/envs/__init__.py @@ -0,0 +1 @@ +from gym_random_walk.envs.random_walk_env import RandomWalkEnv diff --git a/gym_random_walk/envs/random_walk_py b/gym_random_walk/envs/random_walk_py new file mode 100644 index 0000000..0a4543e --- /dev/null +++ b/gym_random_walk/envs/random_walk_py @@ -0,0 +1,15 @@ +import gym +from gym import error, spaces, utils +from gym.utils import seeding + +class RandomWalkEnv(gym.Env): + metadata = {'render.modes': ['human']} + + def __init__(self): + print("init") + def _step(self, action): + print("step") + def _reset(self): + print("reset") + def _render(self, mode='human', close=False): + print("render") diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..94e890b --- /dev/null +++ b/setup.py @@ -0,0 +1,7 @@ +from setuptools import setup + +setup(name='gym_random_walk', + version='0.0.1', + install_requires=['gym'] +) +