diff --git a/gym_mygame/envs/mygame.py b/gym_mygame/envs/mygame.py index 9cada76..89ca693 100644 --- a/gym_mygame/envs/mygame.py +++ b/gym_mygame/envs/mygame.py @@ -24,7 +24,7 @@ def __init__(self): def step(self, action): - state = [0] + state = np.zeros(1, dtype=np.float32) reward = 0 terminated = False truncated = False @@ -36,9 +36,17 @@ def render(self, mode='human'): pass - def reset(self): + def reset(self, seed=None, options={}): - return [0] + if seed is not None: + + pass # XXX Seed the random-number generator + + obs = np.zeros(1, dtype=np.float32) + + info = {} + + return obs, info def close(self): diff --git a/test.py b/test.py index 499d8f4..6e07ae9 100755 --- a/test.py +++ b/test.py @@ -15,14 +15,12 @@ for i_episode in range(20): - observation = env.reset() + observation, _ = env.reset(seed=123) for t in range(100): env.render() - print(observation) - action = env.action_space.sample() observation, reward, terminated, truncated, info = env.step(action)