podondra / gym-gridworlds

Gridworld environments for OpenAI gym.
MIT License
80 stars 19 forks source link

reset not working #4

Closed Sushant-ctrl closed 4 years ago

Sushant-ctrl commented 4 years ago
import gym
import gym_gridworlds
env = gym.make('Gridworld-v0')  # substitute environment's name

for i in range (10):
    print(i)
    done = False
    state = env.reset()
    while not done:
        next_state, reward, done, _ = env.step(env.action_space.sample())
        print(state, 'state')

        state = next_state

This segment of code gives this error


Traceback (most recent call last):
  File "/home/sushant/Desktop/clone1/Model Free Prediction/Temporal Difference/TD prediction.py", line 9, in <module>
    state = env.reset()
  File "/home/sushant/anaconda3/envs/rl/lib/python3.6/site-packages/gym/core.py", line 64, in reset
    raise NotImplementedError
NotImplementedError```
podondra commented 4 years ago

I guess, there is no default state. Any comments?

Sushant-ctrl commented 4 years ago

Yes I found that out Thanks!