Skip to content

Commit

Permalink
Add done state: on_broken_line_done (#710)
Browse files Browse the repository at this point in the history
* add on_broken_line_done

* fix

---------

Co-authored-by: pengzhenghao <[email protected]>
  • Loading branch information
bongbui321 and pengzhenghao authored Aug 20, 2024
1 parent aaed1f7 commit 880fcd0
Showing 1 changed file with 3 additions and 0 deletions.
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

0 comments on commit 880fcd0

Please sign in to comment.