fixed incorrect sampling in hole reacher
This commit is contained in:
parent
724b8c6c61
commit
17c489d622
@ -105,8 +105,8 @@ class HoleReacherEnv(MPEnv):
|
|||||||
return self._get_obs().copy()
|
return self._get_obs().copy()
|
||||||
|
|
||||||
def _generate_hole(self):
|
def _generate_hole(self):
|
||||||
self._tmp_hole_x = self.np_random.uniform(0.5, 3.5, 1) if self._hole_x is None else np.copy(self._hole_x)
|
self._tmp_hole_x = self.np_random.uniform(1, 3.5, 1) if self._hole_x is None else np.copy(self._hole_x)
|
||||||
self._tmp_hole_width = self.np_random.uniform(0.5, 0.1, 1) if self._hole_width is None else np.copy(
|
self._tmp_hole_width = self.np_random.uniform(0.15, 0.5, 1) if self._hole_width is None else np.copy(
|
||||||
self._hole_width)
|
self._hole_width)
|
||||||
# TODO we do not want this right now.
|
# TODO we do not want this right now.
|
||||||
self._tmp_hole_depth = self.np_random.uniform(1, 1, 1) if self._hole_depth is None else np.copy(
|
self._tmp_hole_depth = self.np_random.uniform(1, 1, 1) if self._hole_depth is None else np.copy(
|
||||||
@ -310,11 +310,12 @@ if __name__ == '__main__':
|
|||||||
hole_depth=1, hole_x=None)
|
hole_depth=1, hole_x=None)
|
||||||
obs = env.reset()
|
obs = env.reset()
|
||||||
|
|
||||||
for i in range(200):
|
for i in range(2000):
|
||||||
# objective.load_result("/tmp/cma")
|
# objective.load_result("/tmp/cma")
|
||||||
# test with random actions
|
# test with random actions
|
||||||
ac = 2 * env.action_space.sample()
|
ac = 2 * env.action_space.sample()
|
||||||
obs, rew, d, info = env.step(ac)
|
obs, rew, d, info = env.step(ac)
|
||||||
|
if i % 10 == 0:
|
||||||
env.render(mode=render_mode)
|
env.render(mode=render_mode)
|
||||||
|
|
||||||
print(rew)
|
print(rew)
|
||||||
|
Loading…
Reference in New Issue
Block a user