Skip to content

Commit

Permalink
save _horizon during setup
Browse files Browse the repository at this point in the history
  • Loading branch information
vmoens authored and vikashplus committed Jan 12, 2024
1 parent 82c6ab4 commit b8283d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion robohive/envs/env_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ def _setup(self,
assert not done, "Check initialization. Simulation starts in a done state."
self.observation_space = gym.spaces.Box(obs_range[0]*np.ones(observation.size), obs_range[1]*np.ones(observation.size), dtype=np.float32)

# we copy the horizon to avoid having gymnasium hijacking it later
self._horizon = self.spec.max_episode_steps

return


Expand Down Expand Up @@ -533,7 +536,7 @@ def id(self):

@property
def horizon(self):
return self.spec.max_episode_steps # paths could have early termination before horizon
return self._horizon # paths could have early termination before horizon


def get_env_state(self):
Expand Down

0 comments on commit b8283d2

Please sign in to comment.