Skip to content

Commit

Permalink
maximum -> max
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Untergassmair committed Nov 26, 2019
1 parent 32418d1 commit b8abe43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/actions/lane_following_accel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function propagate(veh::Vehicle1D, action::LaneFollowingAccel, roadway::Straight
s, v = veh.state.s, veh.state.v

s′ = s + v*Δt + a*Δt*Δt/2
v′ = maximum((v + a*Δt, 0.)) # no negative velocities
v′ = max(v + a*Δt, 0.) # no negative velocities

s′ = mod_position_to_roadway(s′, roadway)

Expand All @@ -32,7 +32,7 @@ function propagate(veh::Entity{VehicleState,D,I}, action::LaneFollowingAccel, ro
ΔT² = ΔT*ΔT
Δs = ds*ΔT + 0.5*a_lon*ΔT²

v₂ = maximum((ds + a_lon*ΔT, 0.)) # no negative velocities
v₂ = max(ds + a_lon*ΔT, 0.) # no negative velocities

roadind = move_along(posf(veh.state).roadind, roadway, Δs)
posG = roadway[roadind].pos
Expand Down

0 comments on commit b8abe43

Please sign in to comment.