Open epignatelli opened 6 months ago
You can temporarily patch it with this
class PatchTimeoutWrapper(gym.Wrapper):
def __init__(self, env: gym.Env):
super().__init__(env)
self.unwrapped._max_episode_steps = self._max_episode_steps
And use:
env = gym.make(
"MiniHack-KeyRoom-S5-v0",
reward_lose=-1.0,
max_episode_steps=MAX_STEPS,
)
env = PatchTimeoutWrapper(env)
🐛 Bug
When setting
max_episode_steps
, whilegym
correctly triggers a reset, MiniHack (and perhaps even NLE) does not setStepStatus.ABORTED
.As a consequence, the reward for Timeout is not
reward_lose
.To Reproduce
Expected behavior
int(info["end_status"])
should be-1
Potential reasons
gym.make
acceptsmax_episode_steps
as argument. For this reason,max_episode_steps
is not included inkwargs
and it is not passed through to the MiniHack constructor.