Skip to content

Commit

Permalink
BUGFIX: using implement for to get horizon form proper place
Browse files Browse the repository at this point in the history
  • Loading branch information
vikashplus committed Jan 20, 2024
1 parent 750f6c3 commit 77b4347
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions robohive/envs/env_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,16 @@ def time(self):
def id(self):
return self.spec.id


@implement_for("gym")
def _horizon(self):
return self.spec.max_episode_steps # paths could have early termination before horizon
@implement_for("gymnasium")
def _horizon(self):
return gym_registry_specs()[self.spec.id].max_episode_steps # gymnasium unwrapper overrides specs (https://github.com/Farama-Foundation/Gymnasium/issues/871)
@property
def horizon(self):
# return self.spec.max_episode_steps # paths could have early termination before horizon
return gym_registry_specs()[self.spec.id].max_episode_steps
return self._horizon()


def get_env_state(self):
Expand Down

0 comments on commit 77b4347

Please sign in to comment.