Class LmrsUtil
- java.lang.Object
-
- org.opentrafficsim.road.gtu.lane.tactical.util.lmrs.LmrsUtil
-
- All Implemented Interfaces:
LmrsParameters
public final class LmrsUtil extends Object implements LmrsParameters
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 Jul 26, 2016
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Field Summary
Fields Modifier and Type Field Description static ParameterTypeAcceleration
BCRIT
Maximum critical deceleration, e.g.static ParameterTypeDuration
DT
Fixed model time step.static ParameterTypeDuration
T
Current car-following headway.static ParameterTypeDuration
TAU
Headway relaxation time.static ParameterTypeDuration
TMAX
Maximum car-following headway.static ParameterTypeDuration
TMIN
Minimum car-following headway.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SimpleOperationalPlan
determinePlan(LaneBasedGTU gtu, 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 Desire
getLaneChangeDesire(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 Acceleration
singleAcceleration(Length distance, Speed followerSpeed, Speed leaderSpeed, double desire, Parameters params, SpeedLimitInfo sli, CarFollowingModel cfm)
Determine acceleration from car-following with desire-adjusted headway.
-
-
-
Field Detail
-
DT
public static final ParameterTypeDuration DT
Fixed model time step.
-
TMIN
public static final ParameterTypeDuration TMIN
Minimum car-following headway.
-
T
public static final ParameterTypeDuration T
Current car-following headway.
-
TMAX
public static final ParameterTypeDuration TMAX
Maximum car-following headway.
-
TAU
public static final ParameterTypeDuration TAU
Headway relaxation time.
-
BCRIT
public static final ParameterTypeAcceleration BCRIT
Maximum critical deceleration, e.g. stop/go at traffic light.
-
-
Method Detail
-
determinePlan
public static SimpleOperationalPlan determinePlan(LaneBasedGTU gtu, Time startTime, CarFollowingModel carFollowingModel, LaneChange laneChange, LmrsData lmrsData, LanePerception perception, Iterable<MandatoryIncentive> mandatoryIncentives, Iterable<VoluntaryIncentive> voluntaryIncentives) throws GTUException, NetworkException, ParameterException, OperationalPlanException
Determines a simple representation of an operational plan.- Parameters:
gtu
- LaneBasedGTU; gtustartTime
- Time; start timecarFollowingModel
- CarFollowingModel; car-following modellaneChange
- LaneChange; lane change statuslmrsData
- LmrsData; LMRS dataperception
- LanePerception; perceptionmandatoryIncentives
- Iterable<MandatoryIncentive>; set of mandatory lane change incentivesvoluntaryIncentives
- Iterable<VoluntaryIncentive>; 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, GTUException, OperationalPlanException
Determines 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; parametersperception
- LanePerception; perceptioncarFollowingModel
- CarFollowingModel; car-following modelmandatoryIncentives
- Iterable<MandatoryIncentive>; mandatory incentivesvoluntaryIncentives
- Iterable<VoluntaryIncentive>; voluntary incentivesdesireMap
- Map<Class<? extends Incentive>,Desire>; 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 oneOperationalPlanException
- perception exception
-
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
- Length; distance from follower to leaderfollowerSpeed
- Speed; speed of followerleaderSpeed
- Speed; speed of leaderdesire
- double; level of lane change desireparams
- Parameters; parameterssli
- SpeedLimitInfo; speed limit infocfm
- CarFollowingModel; car-following model- Returns:
- acceleration from car-following
- Throws:
ParameterException
- if a parameter is not defined
-
-