Class AbstractIDM
- java.lang.Object
-
- org.opentrafficsim.road.gtu.lane.tactical.following.AbstractCarFollowingModel
-
- org.opentrafficsim.road.gtu.lane.tactical.following.AbstractIDM
-
- All Implemented Interfaces:
CarFollowingModel
,DesiredHeadwayModel
,DesiredSpeedModel
,Initialisable
- Direct Known Subclasses:
IDM
,IDMPlus
,IDMPlusMulti
public abstract class AbstractIDM extends AbstractCarFollowingModel
Implementation of the IDM. See https://en.wikipedia.org/wiki/Intelligent_driver_modelCopyright (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 Apr 22, 2016
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Field Summary
Fields Modifier and Type Field Description protected static ParameterTypeAcceleration
A
Acceleration parameter type.protected static ParameterTypeAcceleration
B
Comfortable deceleration parameter type.protected static ParameterTypeAcceleration
B0
Adjustment deceleration parameter type.static ParameterTypeDouble
DELTA
Acceleration flattening.static DesiredSpeedModel
DESIRED_SPEED
Default IDM desired speed model.protected static ParameterTypeDouble
FSPEED
Speed limit adherence factor parameter type.static DesiredHeadwayModel
HEADWAY
Default IDM desired headway model.protected static ParameterTypeLength
S0
Stopping distance parameter type.protected static ParameterTypeDuration
T
Desired headway parameter type.-
Fields inherited from interface org.opentrafficsim.road.gtu.lane.tactical.following.CarFollowingModel
CAR_FOLLOWING_MODEL
-
-
Constructor Summary
Constructors Constructor Description AbstractIDM(DesiredHeadwayModel desiredHeadwayModel, DesiredSpeedModel desiredSpeedModel)
Constructor with modular models for desired headway and desired speed.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Acceleration
combineInteractionTerm(Acceleration aFree, Parameters parameters, Speed speed, Speed desiredSpeed, Length desiredHeadway, PerceptionIterable<? extends Headway> leaders)
Combines an interaction term with the free term.protected Length
dynamicDesiredHeadway(Parameters parameters, Speed speed, Length desiredHeadway, Speed leaderSpeed)
Determines the dynamic desired headway, which is non-negative.protected Length
dynamicHeadwayTerm(Parameters parameters, Speed speed, Speed leaderSpeed)
Determines the dynamic headway term.protected Acceleration
followingAcceleration(Parameters parameters, Speed speed, Speed desiredSpeed, Length desiredHeadway, PerceptionIterable<? extends Headway> leaders)
Determination of car-following acceleration, possibly based on multiple leaders.-
Methods inherited from class org.opentrafficsim.road.gtu.lane.tactical.following.AbstractCarFollowingModel
desiredHeadway, desiredSpeed, followingAcceleration, init, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opentrafficsim.road.gtu.lane.tactical.following.CarFollowingModel
getLongName, getName
-
-
-
-
Field Detail
-
A
protected static final ParameterTypeAcceleration A
Acceleration parameter type.
-
B
protected static final ParameterTypeAcceleration B
Comfortable deceleration parameter type.
-
T
protected static final ParameterTypeDuration T
Desired headway parameter type.
-
S0
protected static final ParameterTypeLength S0
Stopping distance parameter type.
-
B0
protected static final ParameterTypeAcceleration B0
Adjustment deceleration parameter type.
-
FSPEED
protected static final ParameterTypeDouble FSPEED
Speed limit adherence factor parameter type.
-
DELTA
public static final ParameterTypeDouble DELTA
Acceleration flattening.
-
HEADWAY
public static final DesiredHeadwayModel HEADWAY
Default IDM desired headway model.
-
DESIRED_SPEED
public static final DesiredSpeedModel DESIRED_SPEED
Default IDM desired speed model.
-
-
Constructor Detail
-
AbstractIDM
public AbstractIDM(DesiredHeadwayModel desiredHeadwayModel, DesiredSpeedModel desiredSpeedModel)
Constructor with modular models for desired headway and desired speed.- Parameters:
desiredHeadwayModel
- DesiredHeadwayModel; desired headway modeldesiredSpeedModel
- DesiredSpeedModel; desired speed model
-
-
Method Detail
-
followingAcceleration
protected Acceleration followingAcceleration(Parameters parameters, Speed speed, Speed desiredSpeed, Length desiredHeadway, PerceptionIterable<? extends Headway> leaders) throws ParameterException
Determination of car-following acceleration, possibly based on multiple leaders. This implementation calculates the IDM free term, which is returned if there are no leaders. If there are leaderscombineInteractionTerm()
is invoked to combine the free term with some implementation specific interaction term. The IDM free term is limited by a deceleration ofB0
for cases where the current speed is above the desired speed. This method can be overridden if the free term needs to be redefined.- Specified by:
followingAcceleration
in classAbstractCarFollowingModel
- Parameters:
parameters
- Parameters; Parameters.speed
- Speed; Current speed.desiredSpeed
- Speed; Desired speed.desiredHeadway
- Length; Desired headway.leaders
- PerceptionIterable<? extends Headway>; Set of leader headways (guaranteed positive) and speeds, ordered by headway (closest first).- Returns:
- Car-following acceleration.
- Throws:
ParameterException
- If parameter exception occurs.
-
combineInteractionTerm
protected abstract Acceleration combineInteractionTerm(Acceleration aFree, Parameters parameters, Speed speed, Speed desiredSpeed, Length desiredHeadway, PerceptionIterable<? extends Headway> leaders) throws ParameterException
Combines an interaction term with the free term. There should be at least 1 leader for this method.- Parameters:
aFree
- Acceleration; Free term of acceleration.parameters
- Parameters; Parameters.speed
- Speed; Current speed.desiredSpeed
- Speed; Desired speed.desiredHeadway
- Length; Desired headway.leaders
- PerceptionIterable<? extends Headway>; Set of leader headways (guaranteed positive) and speeds, ordered by headway (closest first).- Returns:
- Combination of terms into a single acceleration.
- Throws:
ParameterException
- In case of parameter exception.
-
dynamicDesiredHeadway
protected final Length dynamicDesiredHeadway(Parameters parameters, Speed speed, Length desiredHeadway, Speed leaderSpeed) throws ParameterException
Determines the dynamic desired headway, which is non-negative.- Parameters:
parameters
- Parameters; Parameters.speed
- Speed; Current speed.desiredHeadway
- Length; Desired headway.leaderSpeed
- Speed; Speed of the leading vehicle.- Returns:
- Dynamic desired headway.
- Throws:
ParameterException
- In case of parameter exception.
-
dynamicHeadwayTerm
protected final Length dynamicHeadwayTerm(Parameters parameters, Speed speed, Speed leaderSpeed) throws ParameterException
Determines the dynamic headway term. May be used on individual leaders for multi-anticipative following.- Parameters:
parameters
- Parameters; Parameters.speed
- Speed; Current speed.leaderSpeed
- Speed; Speed of the leading vehicle.- Returns:
- Dynamic headway term.
- Throws:
ParameterException
- In case of parameter exception.
-
-