Class SpeedLimitUtil
java.lang.Object
org.opentrafficsim.road.gtu.lane.tactical.util.SpeedLimitUtil
Static methods regarding speed limits for composition in tactical planners.
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.opentrafficsim.base.parameters.ParameterTypeAcceleration
Maximum comfortable acceleration in the lateral direction. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.djunits.value.vdouble.scalar.Acceleration
considerSpeedLimitTransitions
(org.opentrafficsim.base.parameters.Parameters parameters, org.djunits.value.vdouble.scalar.Speed speed, SpeedLimitProspect speedLimitProspect, CarFollowingModel carFollowingModel) Acceleration for speed limit transitions.static org.djunits.value.vdouble.scalar.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 org.djunits.value.vdouble.scalar.Speed
getMaximumVehicleSpeed
(SpeedLimitInfo speedLimitInfo) Returns the speed of speed limit type MAX_VEHICLE_SPEED.
-
Field Details
-
A_LAT
public static final org.opentrafficsim.base.parameters.ParameterTypeAcceleration A_LATMaximum comfortable acceleration in the lateral direction.
-
-
Method Details
-
getLegalSpeedLimit
public static org.djunits.value.vdouble.scalar.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 org.djunits.value.vdouble.scalar.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 org.djunits.value.vdouble.scalar.Acceleration considerSpeedLimitTransitions(org.opentrafficsim.base.parameters.Parameters parameters, org.djunits.value.vdouble.scalar.Speed speed, SpeedLimitProspect speedLimitProspect, CarFollowingModel carFollowingModel) throws org.opentrafficsim.base.parameters.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:
org.opentrafficsim.base.parameters.ParameterException
- if a required parameter is not found
-