Class SpeedLimitUtil
- java.lang.Object
-
- org.opentrafficsim.road.gtu.lane.tactical.util.SpeedLimitUtil
-
public final class SpeedLimitUtil extends Object
Static methods regarding speed limits for composition in tactical planners.Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version May 20, 2016
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Field Summary
Fields Modifier and Type Field Description static ParameterTypeAcceleration
A_LAT
Maximum comfortable acceleration in the lateral direction.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Acceleration
considerSpeedLimitTransitions(Parameters parameters, Speed speed, SpeedLimitProspect speedLimitProspect, CarFollowingModel carFollowingModel)
Acceleration for speed limit transitions.static Speed
getLegalSpeedLimit(SpeedLimitInfo speedLimitInfo)
Returns the minimum speed of the applicable speed limit types MAX_LEGAL_VEHICLE_SPEED, ROAD_CLASS, FIXED_SIGN and DYNAMIC_SIGN.static Speed
getMaximumVehicleSpeed(SpeedLimitInfo speedLimitInfo)
Returns the speed of speed limit type MAX_VEHICLE_SPEED.
-
-
-
Field Detail
-
A_LAT
public static final ParameterTypeAcceleration A_LAT
Maximum comfortable acceleration in the lateral direction.
-
-
Method Detail
-
getLegalSpeedLimit
public static Speed getLegalSpeedLimit(SpeedLimitInfo speedLimitInfo)
Returns the minimum speed of the applicable speed limit types MAX_LEGAL_VEHICLE_SPEED, ROAD_CLASS, FIXED_SIGN and DYNAMIC_SIGN. ROAD_CLASS is only used if FIXED_SIGN and DYNAMIC_SIGN are not present. This method may be overridden by subclasses to implement additional behavior regarding legal speed limits.- Parameters:
speedLimitInfo
- SpeedLimitInfo; speed limit info- Returns:
- minimum of speed of speed limit types
- Throws:
NullPointerException
- if speed limit info is null
-
getMaximumVehicleSpeed
public static Speed getMaximumVehicleSpeed(SpeedLimitInfo speedLimitInfo)
Returns the speed of speed limit type MAX_VEHICLE_SPEED. This method may be overridden by subclasses to implement additional behavior regarding maximum vehicle speed limits.- Parameters:
speedLimitInfo
- SpeedLimitInfo; speed limit info- Returns:
- speed of speed limit type MAX_VEHICLE_SPEED
- Throws:
NullPointerException
- if speed limit info is null
-
considerSpeedLimitTransitions
public static Acceleration considerSpeedLimitTransitions(Parameters parameters, Speed speed, SpeedLimitProspect speedLimitProspect, CarFollowingModel carFollowingModel) throws ParameterException
Acceleration for speed limit transitions. This implementation decelerates before curves and speed bumps. For this it usesapproachTargetSpeed()
of the abstract car-following model implementation. All remaining transitions happen in the default manner, i.e. deceleration and acceleration after the speed limit change and governed by the car-following model.- Parameters:
parameters
- Parameters; parametersspeed
- Speed; current speedspeedLimitProspect
- SpeedLimitProspect; speed limit prospectcarFollowingModel
- CarFollowingModel; car following model- Returns:
- acceleration for speed limit transitions
- Throws:
ParameterException
- if a required parameter is not found
-
-