Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] The params self.new_lap seems not used on the truncated condition in CarRacing-v2? #3149

Open
Guosy0506 opened this issue Nov 12, 2022 · 2 comments

Comments

@Guosy0506
Copy link

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.

test_truncation.zip

@Guosy0506
Copy link
Author

Sorry, it is my first time to commit an issue on github, maybe there are something wrong.... :(

@pseudo-rnd-thoughts
Copy link
Contributor

Thanks for the issue, that looks like an interesting issue. This looks linked to #2890 and Farama-Foundation/Gymnasium#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants