Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure correct seeding behaviour. Using the self.np_random rather tha… #468

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions metaworld/envs/mujoco/sawyer_xyz/sawyer_xyz_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,10 @@ def evaluate_state(self, obs, action):
raise NotImplementedError

def reset(self, seed=None, options=None):
if seed:
self.seed(seed)
self.curr_path_length = 0
obs, info = super().reset()
obs, info = super().reset(seed=seed)
self._prev_obs = obs[:18].copy()
obs[18:36] = self._prev_obs
obs = np.float64(obs)
Expand All @@ -544,7 +546,7 @@ def _get_state_rand_vec(self):
assert self._last_rand_vec is not None
return self._last_rand_vec
else:
rand_vec = np.random.uniform(
rand_vec = self.np_random.uniform(
self._random_reset_space.low,
self._random_reset_space.high,
size=self._random_reset_space.low.size,
Expand Down
Loading