Skip to content

Commit

Permalink
Clarify relationship between reset() and RNGs (openai#2019)
Browse files Browse the repository at this point in the history
The current docstring for `reset()` seems to indicate that the
environment will be identical after separate calls to `reset()`.
However, the `reset()` function isn't supposed to reset the states of
the environment's RNGs [1]. This change clarifies the relationship
between the `reset()` function and the RNGs.

[1]: openai#250
  • Loading branch information
jturner314 committed Aug 28, 2020
1 parent d756847 commit 1766899
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gym/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ def step(self, action):
raise NotImplementedError

def reset(self):
"""Resets the state of the environment and returns an initial observation.
"""Resets the environment to an initial state and returns an initial
observation.
Note that this function should not reset the environment's random
number generator(s); random variables in the environment's state should
be sampled independently between multiple calls to `reset()`. In other
words, each call of `reset()` should yield an environment suitable for
a new episode, independent of previous episodes.
Returns:
observation (object): the initial observation.
Expand Down

0 comments on commit 1766899

Please sign in to comment.