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 committed Jan 27, 2024
1 parent dcdfef3 commit 6577ef6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion highway_env/vehicle/behavior.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,10 @@ def acceleration_features(
) -> np.ndarray:
vt, dv, dp = 0, 0, 0
if ego_vehicle:
vt = getattr(ego_vehicle, "target_speed", ego_vehicle.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 6577ef6

Please sign in to comment.