diff --git a/mo_gymnasium/envs/mujoco/ant_v4.py b/mo_gymnasium/envs/mujoco/ant_v4.py index cc2ba7e..852c395 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_objetive = 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_objetive: 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 77c6597..a84dade 100644 --- a/mo_gymnasium/envs/mujoco/ant_v5.py +++ b/mo_gymnasium/envs/mujoco/ant_v5.py @@ -32,7 +32,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_objetive = 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): cost = info["reward_ctrl"] healthy_reward = info["reward_survive"] - if self.cost_objetive: + if self._cost_objetive: 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 6fe0ed3..0d24b3a 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_objetive = 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_objetive: 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 1c4e6d1..3345461 100644 --- a/mo_gymnasium/envs/mujoco/hopper_v5.py +++ b/mo_gymnasium/envs/mujoco/hopper_v5.py @@ -22,7 +22,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_objetive = 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,))