MattChanTK / gym-maze

A basic 2D maze environment where an agent start from the top left corner and try to find its way to the bottom left corner.
353 stars 110 forks source link

Resetting env to a specific state #12

Open vsindato opened 4 years ago

vsindato commented 4 years ago

Hi Matt,

I loved using this env. It's very simple and smooth to use and understand. I was using it for practice while learning monte-carlo control..and this technique requires randomly selecting initial states in each episode and following the trajectory from that to the terminal state. I couldn't do this directly with your env because resetting it always sets the state as (0,0).

Maybe adding an optional argument in the reset method for desired start state could people some time in the future. Regardless, thank you for this gift!

shamrous commented 3 years ago

I had the same issue. File maze_env.py should be amended. Replace the line to self.state = np.zeros(2, dtype=int)