From 1b4639645f79e273c46ee65e97a4b687b905c2e3 Mon Sep 17 00:00:00 2001 From: Kallinteris Andreas <30759571+Kallinteris-Andreas@users.noreply.github.com> Date: Mon, 11 Mar 2024 20:16:31 +0200 Subject: [PATCH] `MuJoCo` refactor remove single line function `_reset_simulation()` --- gymnasium/envs/mujoco/mujoco_env.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/gymnasium/envs/mujoco/mujoco_env.py b/gymnasium/envs/mujoco/mujoco_env.py index 4a0b3c056..fc654387c 100644 --- a/gymnasium/envs/mujoco/mujoco_env.py +++ b/gymnasium/envs/mujoco/mujoco_env.py @@ -120,12 +120,6 @@ def _initialize_simulation(self) -> Tuple[Any, Any]: """ raise NotImplementedError - def _reset_simulation(self) -> None: - """ - Reset MuJoCo simulation data structures, mjModel and mjData. - """ - raise NotImplementedError - def _step_mujoco_simulation(self, ctrl, n_frames) -> None: """ Step over the MuJoCo simulation. @@ -151,7 +145,7 @@ def reset( ): super().reset(seed=seed) - self._reset_simulation() + mujoco.mj_resetData(self.model, self.data) ob = self.reset_model() info = self._get_reset_info() @@ -244,9 +238,6 @@ def _initialize_simulation( data = mujoco.MjData(model) return model, data - def _reset_simulation(self): - mujoco.mj_resetData(self.model, self.data) - def set_state(self, qpos, qvel): super().set_state(qpos, qvel) self.data.qpos[:] = np.copy(qpos)