Skip to content

Commit

Permalink
Fix mobil's prediction of a vehicle's behaviour without knowledge of …
Browse files Browse the repository at this point in the history
…its target_speed

Fix #563
  • Loading branch information
eleurent authored Jan 27, 2024
1 parent 17059b8 commit dcdfef3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion highway_env/vehicle/behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ def acceleration_features(
) -> np.ndarray:
vt, dv, dp = 0, 0, 0
if ego_vehicle:
vt = ego_vehicle.target_speed - ego_vehicle.speed
vt = getattr(ego_vehicle, "target_speed", ego_vehicle.speed) - ego_vehicle.speed
d_safe = (
self.DISTANCE_WANTED
+ np.maximum(ego_vehicle.speed, 0) * self.TIME_WANTED
Expand Down

0 comments on commit dcdfef3

Please sign in to comment.