From a515cf161b6dcc78ad7fc1948b50cdebbe8d3a3b Mon Sep 17 00:00:00 2001 From: Lucas Alegre Date: Mon, 28 Oct 2024 12:13:03 -0300 Subject: [PATCH] Fix typo --- mo_gymnasium/envs/mujoco/ant_v4.py | 4 ++-- mo_gymnasium/envs/mujoco/ant_v5.py | 4 ++-- mo_gymnasium/envs/mujoco/hopper_v4.py | 4 ++-- mo_gymnasium/envs/mujoco/hopper_v5.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mo_gymnasium/envs/mujoco/ant_v4.py b/mo_gymnasium/envs/mujoco/ant_v4.py index 852c395..695b6d5 100644 --- a/mo_gymnasium/envs/mujoco/ant_v4.py +++ b/mo_gymnasium/envs/mujoco/ant_v4.py @@ -28,7 +28,7 @@ class MOAntEnv(AntEnv, EzPickle): def __init__(self, cost_objective=True, **kwargs): super().__init__(**kwargs) EzPickle.__init__(self, cost_objective, **kwargs) - self._cost_objetive = cost_objective + self._cost_objective = cost_objective self.reward_dim = 3 if cost_objective else 2 self.reward_space = Box(low=-np.inf, high=np.inf, shape=(self.reward_dim,)) @@ -39,7 +39,7 @@ def step(self, action): cost = info["reward_ctrl"] healthy_reward = info["reward_survive"] - if self._cost_objetive: + if self._cost_objective: cost /= self._ctrl_cost_weight # Ignore the weight in the original AntEnv vec_reward = np.array([x_velocity, y_velocity, cost], dtype=np.float32) else: diff --git a/mo_gymnasium/envs/mujoco/ant_v5.py b/mo_gymnasium/envs/mujoco/ant_v5.py index b70ae18..8d4d9ae 100644 --- a/mo_gymnasium/envs/mujoco/ant_v5.py +++ b/mo_gymnasium/envs/mujoco/ant_v5.py @@ -36,7 +36,7 @@ class MOAntEnv(AntEnv, EzPickle): def __init__(self, cost_objective=True, **kwargs): super().__init__(**kwargs) EzPickle.__init__(self, cost_objective, **kwargs) - self._cost_objetive = cost_objective + self._cost_objective = cost_objective self.reward_dim = 3 if cost_objective else 2 self.reward_space = Box(low=-np.inf, high=np.inf, shape=(self.reward_dim,)) @@ -47,7 +47,7 @@ def step(self, action): cost = info["reward_ctrl"] healthy_reward = info["reward_survive"] - if self._cost_objetive: + if self._cost_objective: cost /= self._ctrl_cost_weight # Ignore the weight in the original AntEnv vec_reward = np.array([x_velocity, y_velocity, cost], dtype=np.float32) else: diff --git a/mo_gymnasium/envs/mujoco/hopper_v4.py b/mo_gymnasium/envs/mujoco/hopper_v4.py index 0d24b3a..6da2bd3 100644 --- a/mo_gymnasium/envs/mujoco/hopper_v4.py +++ b/mo_gymnasium/envs/mujoco/hopper_v4.py @@ -27,7 +27,7 @@ class MOHopperEnv(HopperEnv, EzPickle): def __init__(self, cost_objective=True, **kwargs): super().__init__(**kwargs) EzPickle.__init__(self, cost_objective, **kwargs) - self._cost_objetive = cost_objective + self._cost_objective = cost_objective self.reward_dim = 3 if cost_objective else 2 self.reward_space = Box(low=-np.inf, high=np.inf, shape=(self.reward_dim,)) @@ -53,7 +53,7 @@ def step(self, action): height = 10 * (z - self.init_qpos[1]) energy_cost = np.sum(np.square(action)) - if self._cost_objetive: + if self._cost_objective: vec_reward = np.array([x_velocity, height, -energy_cost], dtype=np.float32) else: vec_reward = np.array([x_velocity, height], dtype=np.float32) diff --git a/mo_gymnasium/envs/mujoco/hopper_v5.py b/mo_gymnasium/envs/mujoco/hopper_v5.py index 2ee84ec..9496652 100644 --- a/mo_gymnasium/envs/mujoco/hopper_v5.py +++ b/mo_gymnasium/envs/mujoco/hopper_v5.py @@ -34,7 +34,7 @@ class MOHopperEnv(HopperEnv, EzPickle): def __init__(self, cost_objective=True, **kwargs): super().__init__(**kwargs) EzPickle.__init__(self, cost_objective, **kwargs) - self._cost_objetive = cost_objective + self._cost_objective = cost_objective self.reward_dim = 3 if cost_objective else 2 self.reward_space = Box(low=-np.inf, high=np.inf, shape=(self.reward_dim,)) @@ -43,7 +43,7 @@ def step(self, action): x_velocity = info["x_velocity"] height = 10 * info["z_distance_from_origin"] neg_energy_cost = info["reward_ctrl"] - if self._cost_objetive: + if self._cost_objective: neg_energy_cost /= self._ctrl_cost_weight # Revert the scale applied in the original environment vec_reward = np.array([x_velocity, height, neg_energy_cost], dtype=np.float32) else: