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

Add done state: on_broken_line_done #710

Merged
merged 3 commits into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions metadrive/envs/metadrive_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
# ===== Termination Scheme =====
out_of_route_done=False,
on_continuous_line_done=True,
on_broken_line_done=False,
crash_vehicle_done=True,
crash_object_done=True,
crash_human_done=True,
Expand Down Expand Up @@ -235,6 +236,8 @@ def _is_out_of_road(self, vehicle):
ret = ret or vehicle.out_of_route
elif self.config["on_continuous_line_done"]:
ret = ret or vehicle.on_yellow_continuous_line or vehicle.on_white_continuous_line or vehicle.crash_sidewalk
if self.config["on_broken_line_done"]:
ret = ret or vehicle.on_broken_line
return ret

def reward_function(self, vehicle_id: str):
Expand Down
Loading