diff --git a/gym_random_walk/envs/random_walk_py b/gym_random_walk/envs/random_walk_env.py similarity index 63% rename from gym_random_walk/envs/random_walk_py rename to gym_random_walk/envs/random_walk_env.py index 0a4543e..48017f9 100644 --- a/gym_random_walk/envs/random_walk_py +++ b/gym_random_walk/envs/random_walk_env.py @@ -1,15 +1,21 @@ import gym from gym import error, spaces, utils from gym.utils import seeding +import numpy as np class RandomWalkEnv(gym.Env): metadata = {'render.modes': ['human']} def __init__(self): + self.action_space = spaces.Discrete(2) print("init") def _step(self, action): print("step") + reward = 0 + done = False + return np.array(self.state), reward, done, {} def _reset(self): print("reset") + self.state = 0 # TODO start in a random position def _render(self, mode='human', close=False): print("render")