Skip to content

Commit

Permalink
Fix reset bounds for mountain car (#2965)
Browse files Browse the repository at this point in the history
* Fix reset bounds for mountain car

This was a typo bug that was introduced in ca39816

* Fix reset bounds for mountain_car

This was a typo bug that was introduced in ca39816

* Fixing formatting of files with pre-commit
  • Loading branch information
psc-g committed Jul 15, 2022
1 parent f3f8a97 commit 98a9293
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions gym/envs/classic_control/continuous_mountain_car.py
Expand Up @@ -184,9 +184,7 @@ def reset(
super().reset(seed=seed)
# Note that if you use custom reset bounds, it may lead to out-of-bound
# state/observations.
low, high = utils.maybe_parse_reset_bounds(
options, -0.6, 0.4 # default low
) # default high
low, high = utils.maybe_parse_reset_bounds(options, -0.6, -0.4)
self.state = np.array([self.np_random.uniform(low=low, high=high), 0])
self.renderer.reset()
self.renderer.render_step()
Expand Down
4 changes: 1 addition & 3 deletions gym/envs/classic_control/mountain_car.py
Expand Up @@ -158,9 +158,7 @@ def reset(
super().reset(seed=seed)
# Note that if you use custom reset bounds, it may lead to out-of-bound
# state/observations.
low, high = utils.maybe_parse_reset_bounds(
options, -0.6, 0.4 # default low
) # default high
low, high = utils.maybe_parse_reset_bounds(options, -0.6, -0.4)
self.state = np.array([self.np_random.uniform(low=low, high=high), 0])
self.renderer.reset()
self.renderer.render_step()
Expand Down

0 comments on commit 98a9293

Please sign in to comment.