Lint fixes to mujoco environment (#377)

This commit is contained in:
Alex Ray
2017-02-22 17:24:27 -08:00
committed by Tom Brown
parent 6d7e50e67b
commit f724a72006
12 changed files with 31 additions and 32 deletions

View File

@@ -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):