mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-29 17:45:07 +00:00
Lint fixes to mujoco environment (#377)
This commit is contained in:
@@ -8,9 +8,9 @@ class HopperEnv(mujoco_env.MujocoEnv, utils.EzPickle):
|
||||
utils.EzPickle.__init__(self)
|
||||
|
||||
def _step(self, a):
|
||||
posbefore = self.model.data.qpos[0,0]
|
||||
posbefore = self.model.data.qpos[0, 0]
|
||||
self.do_simulation(a, self.frame_skip)
|
||||
posafter,height,ang = self.model.data.qpos[0:3,0]
|
||||
posafter, height, ang = self.model.data.qpos[0:3, 0]
|
||||
alive_bonus = 1.0
|
||||
reward = (posafter - posbefore) / self.dt
|
||||
reward += alive_bonus
|
||||
@@ -24,7 +24,7 @@ class HopperEnv(mujoco_env.MujocoEnv, utils.EzPickle):
|
||||
def _get_obs(self):
|
||||
return np.concatenate([
|
||||
self.model.data.qpos.flat[1:],
|
||||
np.clip(self.model.data.qvel.flat,-10,10)
|
||||
np.clip(self.model.data.qvel.flat, -10, 10)
|
||||
])
|
||||
|
||||
def reset_model(self):
|
||||
|
Reference in New Issue
Block a user