Skip to content

Commit

Permalink
Add config "out_of_road_done" for MDEnv
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhenghao committed May 14, 2024
1 parent c6594a4 commit 3103a68
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion 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,
out_of_road_done=True,
on_continuous_line_done=True,
crash_vehicle_done=True,
crash_object_done=True,
Expand Down Expand Up @@ -160,7 +161,7 @@ def done_function(self, vehicle_id: str):
"Episode ended! Scenario Index: {} Reason: arrive_dest.".format(self.current_seed),
extra={"log_once": True}
)
if done_info[TerminationState.OUT_OF_ROAD]:
if done_info[TerminationState.OUT_OF_ROAD] and self.config["out_of_road_done"]:
done = True
self.logger.info(
"Episode ended! Scenario Index: {} Reason: out_of_road.".format(self.current_seed),
Expand Down

0 comments on commit 3103a68

Please sign in to comment.