PKU-Alignment / safety-gymnasium

NeurIPS 2023: Safety-Gymnasium: A Unified Safe Reinforcement Learning Benchmark
https://safety-gymnasium.readthedocs.io/en/latest/
Apache License 2.0
369 stars 52 forks source link

[Question] how to change the step of truncation #113

Closed JoeyWu99 closed 3 months ago

JoeyWu99 commented 5 months ago

Required prerequisites

Questions

Hi,I'm a new beginner of the safety_gymnasium. I want to change the step of truncation. I'm trying to change with this code:

from safety_gymnasium.wrappers import SafeTimeLimit
env = SafeTimeLimit(env, max_episode_steps=1000)

However, It doesn't seem to be working. Is there any solution?

muchvo commented 5 months ago

You can change this here, because we predefined a TimeLimitWrapper for each env.

JoeyWu99 commented 5 months ago

Thank you for your reply. I tried to change the 'SafetyPointRace0-v0' environment by changing ‘500’ to ‘1000’ in line #188 of the init.py. : __combine(race_tasks, robots, max_episode_steps=1000) When I tested it I found that the env._max_episode_steps did change to 1000, but it was still truncated at 500 steps.

muchvo commented 5 months ago

Sorry for overlooking that part. We've realized that there are two design aspects that need modification, which are not quite ideal at the moment. We plan to address these in an upcoming release.