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 SummaryFieldsModifier and TypeFieldDescriptionstatic final org.opentrafficsim.base.parameters.ParameterTypeAccelerationMaximum critical deceleration, e.g.static final org.opentrafficsim.base.parameters.ParameterTypeDurationFixed model time step.static final org.opentrafficsim.base.parameters.ParameterTypeDurationCurrent car-following headway.static final org.opentrafficsim.base.parameters.ParameterTypeDurationHeadway relaxation time.static final org.opentrafficsim.base.parameters.ParameterTypeDurationMaximum car-following headway.static final org.opentrafficsim.base.parameters.ParameterTypeDurationMinimum car-following headway.
- 
Method SummaryModifier and TypeMethodDescription(package private) static booleanacceptLaneChange(LanePerception perception, org.opentrafficsim.base.parameters.Parameters params, SpeedLimitInfo sli, CarFollowingModel cfm, double desire, org.djunits.value.vdouble.scalar.Speed ownSpeed, org.djunits.value.vdouble.scalar.Acceleration ownAcceleration, LateralDirectionality lat, GapAcceptance gapAcceptance, LaneChange laneChange) Determine whether a lane change is acceptable (gap, lane markings, etc.).static SimpleOperationalPlandeterminePlan(LaneBasedGtu gtu, org.djunits.value.vdouble.scalar.Time startTime, CarFollowingModel carFollowingModel, LaneChange laneChange, LmrsData lmrsData, LanePerception perception, Iterable<MandatoryIncentive> mandatoryIncentives, Iterable<VoluntaryIncentive> voluntaryIncentives) Determines a simple representation of an operational plan.static DesiregetLaneChangeDesire(org.opentrafficsim.base.parameters.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.(package private) static voidresetDesiredHeadway(org.opentrafficsim.base.parameters.Parameters params) Resets value for T depending on level of lane change desire.(package private) static voidsetDesiredHeadway(org.opentrafficsim.base.parameters.Parameters params, double desire) Sets value for T depending on level of lane change desire.static org.djunits.value.vdouble.scalar.AccelerationsingleAcceleration(org.djunits.value.vdouble.scalar.Length distance, org.djunits.value.vdouble.scalar.Speed followerSpeed, org.djunits.value.vdouble.scalar.Speed leaderSpeed, double desire, org.opentrafficsim.base.parameters.Parameters params, SpeedLimitInfo sli, CarFollowingModel cfm) Determine acceleration from car-following with desire-adjusted headway.
- 
Field Details- 
DTpublic static final org.opentrafficsim.base.parameters.ParameterTypeDuration DTFixed model time step.
- 
TMINpublic static final org.opentrafficsim.base.parameters.ParameterTypeDuration TMINMinimum car-following headway.
- 
Tpublic static final org.opentrafficsim.base.parameters.ParameterTypeDuration TCurrent car-following headway.
- 
TMAXpublic static final org.opentrafficsim.base.parameters.ParameterTypeDuration TMAXMaximum car-following headway.
- 
TAUpublic static final org.opentrafficsim.base.parameters.ParameterTypeDuration TAUHeadway relaxation time.
- 
BCRITpublic static final org.opentrafficsim.base.parameters.ParameterTypeAcceleration BCRITMaximum critical deceleration, e.g. stop/go at traffic light.
 
- 
- 
Method Details- 
determinePlanpublic static SimpleOperationalPlan determinePlan(LaneBasedGtu gtu, org.djunits.value.vdouble.scalar.Time startTime, CarFollowingModel carFollowingModel, LaneChange laneChange, LmrsData lmrsData, LanePerception perception, Iterable<MandatoryIncentive> mandatoryIncentives, Iterable<VoluntaryIncentive> voluntaryIncentives) throws GtuException, NetworkException, org.opentrafficsim.base.parameters.ParameterException, OperationalPlanException Determines a simple representation of an operational plan.- Parameters:
- gtu- LaneBasedGtu; gtu
- startTime- Time; start time
- carFollowingModel- CarFollowingModel; car-following model
- laneChange- LaneChange; lane change status
- lmrsData- LmrsData; LMRS data
- perception- LanePerception; perception
- mandatoryIncentives- Iterable<MandatoryIncentive>; set of mandatory lane change incentives
- voluntaryIncentives- Iterable<VoluntaryIncentive>; set of voluntary lane change incentives
- Returns:
- simple operational plan
- Throws:
- GtuException- gtu exception
- NetworkException- network exception
- org.opentrafficsim.base.parameters.ParameterException- parameter exception
- OperationalPlanException- operational plan exception
 
- 
getLaneChangeDesirepublic static Desire getLaneChangeDesire(org.opentrafficsim.base.parameters.Parameters parameters, LanePerception perception, CarFollowingModel carFollowingModel, Iterable<MandatoryIncentive> mandatoryIncentives, Iterable<VoluntaryIncentive> voluntaryIncentives, Map<Class<? extends Incentive>, Desire> desireMap) throws org.opentrafficsim.base.parameters.ParameterException, GtuException, OperationalPlanExceptionDetermines 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- Parameters; parameters
- perception- LanePerception; perception
- carFollowingModel- CarFollowingModel; car-following model
- mandatoryIncentives- Iterable<MandatoryIncentive>; mandatory incentives
- voluntaryIncentives- Iterable<VoluntaryIncentive>; voluntary incentives
- desireMap- Map<Class<? extends Incentive>,Desire>; map where calculated desires are stored in
- Returns:
- lane change desire for gtu
- Throws:
- org.opentrafficsim.base.parameters.ParameterException- if a parameter is not defined
- GtuException- if there is no mandatory incentive, the model requires at least one
- OperationalPlanException- perception exception
 
- 
acceptLaneChangestatic boolean acceptLaneChange(LanePerception perception, org.opentrafficsim.base.parameters.Parameters params, SpeedLimitInfo sli, CarFollowingModel cfm, double desire, org.djunits.value.vdouble.scalar.Speed ownSpeed, org.djunits.value.vdouble.scalar.Acceleration ownAcceleration, LateralDirectionality lat, GapAcceptance gapAcceptance, LaneChange laneChange) throws org.opentrafficsim.base.parameters.ParameterException, OperationalPlanException Determine whether a lane change is acceptable (gap, lane markings, etc.).- Parameters:
- perception- LanePerception; perception
- params- Parameters; parameters
- sli- SpeedLimitInfo; speed limit info
- cfm- CarFollowingModel; car-following model
- desire- double; level of lane change desire
- ownSpeed- Speed; own speed
- ownAcceleration- Acceleration; current car-following acceleration
- lat- LateralDirectionality; lateral direction for synchronization
- gapAcceptance- GapAcceptance; gap-acceptance model
- laneChange- LaneChange; lane change
- Returns:
- whether a gap is acceptable
- Throws:
- org.opentrafficsim.base.parameters.ParameterException- if a parameter is not defined
- OperationalPlanException- perception exception
 
- 
setDesiredHeadwaystatic void setDesiredHeadway(org.opentrafficsim.base.parameters.Parameters params, double desire) throws org.opentrafficsim.base.parameters.ParameterException Sets value for T depending on level of lane change desire.- Parameters:
- params- Parameters; parameters
- desire- double; lane change desire
- Throws:
- org.opentrafficsim.base.parameters.ParameterException- if T, TMIN or TMAX is not in the parameters
 
- 
resetDesiredHeadwaystatic void resetDesiredHeadway(org.opentrafficsim.base.parameters.Parameters params) throws org.opentrafficsim.base.parameters.ParameterException Resets value for T depending on level of lane change desire.- Parameters:
- params- Parameters; parameters
- Throws:
- org.opentrafficsim.base.parameters.ParameterException- if T is not in the parameters
 
- 
singleAccelerationpublic static org.djunits.value.vdouble.scalar.Acceleration singleAcceleration(org.djunits.value.vdouble.scalar.Length distance, org.djunits.value.vdouble.scalar.Speed followerSpeed, org.djunits.value.vdouble.scalar.Speed leaderSpeed, double desire, org.opentrafficsim.base.parameters.Parameters params, SpeedLimitInfo sli, CarFollowingModel cfm) throws org.opentrafficsim.base.parameters.ParameterException Determine acceleration from car-following with desire-adjusted headway.- Parameters:
- distance- Length; distance from follower to leader
- followerSpeed- Speed; speed of follower
- leaderSpeed- Speed; speed of leader
- desire- double; level of lane change desire
- params- Parameters; parameters
- sli- SpeedLimitInfo; speed limit info
- cfm- CarFollowingModel; car-following model
- Returns:
- acceleration from car-following
- Throws:
- org.opentrafficsim.base.parameters.ParameterException- if a parameter is not defined
 
 
-