Class LmrsUtil
java.lang.Object
org.opentrafficsim.road.gtu.lane.tactical.util.lmrs.LmrsUtil
- All Implemented Interfaces:
LmrsParameters
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
FieldsModifier and TypeFieldDescriptionstatic final ParameterTypeAccelerationMaximum critical deceleration, e.g. stop/go at traffic light.static final ParameterTypeDurationFixed model time step.static final ParameterTypeDurationCurrent car-following headway.static final ObjectParameter key for T.static final ParameterTypeDurationHeadway relaxation time.static final ParameterTypeDurationMaximum car-following headway.static final ParameterTypeDurationMinimum car-following headway. -
Method Summary
Modifier and TypeMethodDescriptionstatic SimpleOperationalPlandeterminePlan(LaneBasedGtu gtu, CarFollowingModel carFollowingModel, LmrsData lmrsData, LanePerception perception, Iterable<MandatoryIncentive> mandatoryIncentives, Iterable<VoluntaryIncentive> voluntaryIncentives) Determines a simple representation of an operational plan.static DesiregetLaneChangeDesire(Parameters parameters, LanePerception perception, CarFollowingModel carFollowingModel, Iterable<MandatoryIncentive> mandatoryIncentives, Iterable<VoluntaryIncentive> voluntaryIncentives, Map<Class<? extends Incentive>, Desire> desireMap) Determines lane change desire for the given GtU.static AccelerationsingleAcceleration(Length distance, Speed followerSpeed, Speed leaderSpeed, double desire, Parameters params, SpeedLimitInfo sli, CarFollowingModel cfm) Determine acceleration from car-following with desire-adjusted headway.
-
Field Details
-
DT
Fixed model time step. -
TMIN
Minimum car-following headway. -
T
Current car-following headway. -
TMAX
Maximum car-following headway. -
TAU
Headway relaxation time. -
BCRIT
Maximum critical deceleration, e.g. stop/go at traffic light. -
T_KEY
Parameter key for T. This value might e.g. be set by relaxation, its initialization, and tailgating.
-
-
Method Details
-
determinePlan
public static SimpleOperationalPlan determinePlan(LaneBasedGtu gtu, CarFollowingModel carFollowingModel, LmrsData lmrsData, LanePerception perception, Iterable<MandatoryIncentive> mandatoryIncentives, Iterable<VoluntaryIncentive> voluntaryIncentives) throws GtuException, NetworkException, ParameterException Determines a simple representation of an operational plan.- Parameters:
gtu- gtucarFollowingModel- car-following modellmrsData- LMRS dataperception- perceptionmandatoryIncentives- set of mandatory lane change incentivesvoluntaryIncentives- set of voluntary lane change incentives- Returns:
- simple operational plan
- Throws:
GtuException- gtu exceptionNetworkException- network exceptionParameterException- parameter exceptionOperationalPlanException- operational plan exception
-
getLaneChangeDesire
public static Desire getLaneChangeDesire(Parameters parameters, LanePerception perception, CarFollowingModel carFollowingModel, Iterable<MandatoryIncentive> mandatoryIncentives, Iterable<VoluntaryIncentive> voluntaryIncentives, Map<Class<? extends Incentive>, Desire> desireMap) throws ParameterException, GtuExceptionDetermines lane change desire for the given GtU. Mandatory desire is deduced as the maximum of a set of mandatory incentives, while voluntary desires are added. Depending on the level of mandatory lane change desire, voluntary desire may be included partially. If both are positive or negative, voluntary desire is fully included. Otherwise, voluntary desire is less considered within the range dSync < |mandatory| < dCoop. The absolute value is used as large negative mandatory desire may also dominate voluntary desire.- Parameters:
parameters- parametersperception- perceptioncarFollowingModel- car-following modelmandatoryIncentives- mandatory incentivesvoluntaryIncentives- voluntary incentivesdesireMap- map where calculated desires are stored in- Returns:
- lane change desire for gtu
- Throws:
ParameterException- if a parameter is not definedGtuException- if there is no mandatory incentive, the model requires at least one
-
singleAcceleration
public static Acceleration singleAcceleration(Length distance, Speed followerSpeed, Speed leaderSpeed, double desire, Parameters params, SpeedLimitInfo sli, CarFollowingModel cfm) throws ParameterException Determine acceleration from car-following with desire-adjusted headway.- Parameters:
distance- distance from follower to leaderfollowerSpeed- speed of followerleaderSpeed- speed of leaderdesire- level of lane change desireparams- parameterssli- speed limit infocfm- car-following model- Returns:
- acceleration from car-following
- Throws:
ParameterException- if a parameter is not defined
-