philtabor / Deep-Q-Learning-Paper-To-Code

MIT License
342 stars 145 forks source link

Fix for Gym environment framework changes #17

Open marginloop opened 1 year ago

marginloop commented 1 year ago

env.reset() returns an observation and info. This fixes issues with the expected size of a tuple.

from gym library api https://www.gymlibrary.dev/api/core/#gym.Env.reset

RETURNS: observation (object) – Observation of the initial state. This will be an element of observation_space (typically a numpy array) and is analogous to the observation returned by step().

info (dictionary) – This dictionary contains auxiliary information complementing observation. It should be analogous to the info returned by step().

env.step returns a tuple with an additional variable. adding a throwaway variable fixes errors with expected return lengths.

from gym library api https://www.gymlibrary.dev/api/core/#gym.Env.step

Accepts an action and returns either a tuple (observation, reward, terminated, truncated, info).