From 98a929303f0596ea20c9568ebab81f703a08a41c Mon Sep 17 00:00:00 2001 From: Pablo Samuel Castro Date: Fri, 15 Jul 2022 05:22:34 -0400 Subject: [PATCH] Fix reset bounds for mountain car (#2965) * Fix reset bounds for mountain car This was a typo bug that was introduced in https://github.com/openai/gym/commit/ca39816943175f4a650753ef39ff1adc2afb2fae * Fix reset bounds for mountain_car This was a typo bug that was introduced in https://github.com/openai/gym/commit/ca39816943175f4a650753ef39ff1adc2afb2fae * Fixing formatting of files with pre-commit --- gym/envs/classic_control/continuous_mountain_car.py | 4 +--- gym/envs/classic_control/mountain_car.py | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/gym/envs/classic_control/continuous_mountain_car.py b/gym/envs/classic_control/continuous_mountain_car.py index 5abf77e314e..2f12f936752 100644 --- a/gym/envs/classic_control/continuous_mountain_car.py +++ b/gym/envs/classic_control/continuous_mountain_car.py @@ -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() diff --git a/gym/envs/classic_control/mountain_car.py b/gym/envs/classic_control/mountain_car.py index 640186db7fb..f5d3e22fe83 100644 --- a/gym/envs/classic_control/mountain_car.py +++ b/gym/envs/classic_control/mountain_car.py @@ -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()