gym
gym copied to clipboard
[Question] The params self.new_lap seems not used on the truncated condition in CarRacing-v2?
Question
Hi all, I am now using the CarRacing-v2 to train my RL algorithm.
when I make the environment by:
env = gym.make("CarRacing-v2").unwrapped
I found that I could NOT finish an episode because of truncation correctly so I view the code of truncation condition as belowed(line552 and 556):
if self.tile_visited_count == len(self.track) or self.new_lap:
truncated = True
the new_lap
will turn into True only on the line 95-97:
if (tile.idx == 0
and self.env.tile_visited_count / len(self.env.track)
> self.lap_complete_percent
):
self.env.new_lap = True
I printed thenew_lap
and found that it was always False.
I solved this problem by deleting tile.idx == 0 and
, and I want to know whether there are some better idea.
If someone is interested my issue, you can download and unzip my file and runpython test_truncation.py
.
Sorry, it is my first time to commit an issue on github, maybe there are something wrong.... :(
Thanks for the issue, that looks like an interesting issue. This looks linked to https://github.com/openai/gym/pull/2890 and https://github.com/Farama-Foundation/Gymnasium/issues/106
We just launched gymnasium, a fork of Gym by the maintainers of Gym for the past 18 months where all maintenance and improvements will happen moving forward. Could you please move this over to the new repo?
If you'd like to read more about the story behind the backstory behind this and our plans going forward, click here.