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
Implementation of the IDM. See https://en.wikipedia.org/wiki/Intelligent_driver_model
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 TypeFieldDescriptionprotected static final org.opentrafficsim.base.parameters.ParameterTypeAcceleration
Acceleration parameter type.protected static final org.opentrafficsim.base.parameters.ParameterTypeAcceleration
Comfortable deceleration parameter type.protected static final org.opentrafficsim.base.parameters.ParameterTypeAcceleration
Adjustment deceleration parameter type.static final org.opentrafficsim.base.parameters.ParameterTypeDouble
Acceleration flattening.static final DesiredSpeedModel
Default IDM desired speed model.protected static final org.opentrafficsim.base.parameters.ParameterTypeDouble
Speed limit adherence factor parameter type.static final DesiredHeadwayModel
Default IDM desired headway model.protected static final org.opentrafficsim.base.parameters.ParameterTypeLength
Stopping distance parameter type.protected static final org.opentrafficsim.base.parameters.ParameterTypeDuration
Desired headway parameter type.Fields inherited from interface org.opentrafficsim.road.gtu.lane.tactical.following.CarFollowingModel
CAR_FOLLOWING_MODEL
-
Constructor Summary
ConstructorDescriptionAbstractIdm
(DesiredHeadwayModel desiredHeadwayModel, DesiredSpeedModel desiredSpeedModel) Constructor with modular models for desired headway and desired speed. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract org.djunits.value.vdouble.scalar.Acceleration
combineInteractionTerm
(org.djunits.value.vdouble.scalar.Acceleration aFree, org.opentrafficsim.base.parameters.Parameters parameters, org.djunits.value.vdouble.scalar.Speed speed, org.djunits.value.vdouble.scalar.Speed desiredSpeed, org.djunits.value.vdouble.scalar.Length desiredHeadway, PerceptionIterable<? extends Headway> leaders) Combines an interaction term with the free term.protected final org.djunits.value.vdouble.scalar.Length
dynamicDesiredHeadway
(org.opentrafficsim.base.parameters.Parameters parameters, org.djunits.value.vdouble.scalar.Speed speed, org.djunits.value.vdouble.scalar.Length desiredHeadway, org.djunits.value.vdouble.scalar.Speed leaderSpeed) Determines the dynamic desired headway, which is non-negative.protected final org.djunits.value.vdouble.scalar.Length
dynamicHeadwayTerm
(org.opentrafficsim.base.parameters.Parameters parameters, org.djunits.value.vdouble.scalar.Speed speed, org.djunits.value.vdouble.scalar.Speed leaderSpeed) Determines the dynamic headway term.protected org.djunits.value.vdouble.scalar.Acceleration
followingAcceleration
(org.opentrafficsim.base.parameters.Parameters parameters, org.djunits.value.vdouble.scalar.Speed speed, org.djunits.value.vdouble.scalar.Speed desiredSpeed, org.djunits.value.vdouble.scalar.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 Details
-
A
protected static final org.opentrafficsim.base.parameters.ParameterTypeAcceleration AAcceleration parameter type. -
B
protected static final org.opentrafficsim.base.parameters.ParameterTypeAcceleration BComfortable deceleration parameter type. -
T
protected static final org.opentrafficsim.base.parameters.ParameterTypeDuration TDesired headway parameter type. -
S0
protected static final org.opentrafficsim.base.parameters.ParameterTypeLength S0Stopping distance parameter type. -
B0
protected static final org.opentrafficsim.base.parameters.ParameterTypeAcceleration B0Adjustment deceleration parameter type. -
FSPEED
protected static final org.opentrafficsim.base.parameters.ParameterTypeDouble FSPEEDSpeed limit adherence factor parameter type. -
DELTA
public static final org.opentrafficsim.base.parameters.ParameterTypeDouble DELTAAcceleration flattening. -
HEADWAY
Default IDM desired headway model. -
DESIRED_SPEED
Default IDM desired speed model.
-
-
Constructor Details
-
AbstractIdm
Constructor with modular models for desired headway and desired speed.- Parameters:
desiredHeadwayModel
- DesiredHeadwayModel; desired headway modeldesiredSpeedModel
- DesiredSpeedModel; desired speed model
-
-
Method Details
-
followingAcceleration
protected org.djunits.value.vdouble.scalar.Acceleration followingAcceleration(org.opentrafficsim.base.parameters.Parameters parameters, org.djunits.value.vdouble.scalar.Speed speed, org.djunits.value.vdouble.scalar.Speed desiredSpeed, org.djunits.value.vdouble.scalar.Length desiredHeadway, PerceptionIterable<? extends Headway> leaders) throws org.opentrafficsim.base.parameters.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:
org.opentrafficsim.base.parameters.ParameterException
- If parameter exception occurs.
-
combineInteractionTerm
protected abstract org.djunits.value.vdouble.scalar.Acceleration combineInteractionTerm(org.djunits.value.vdouble.scalar.Acceleration aFree, org.opentrafficsim.base.parameters.Parameters parameters, org.djunits.value.vdouble.scalar.Speed speed, org.djunits.value.vdouble.scalar.Speed desiredSpeed, org.djunits.value.vdouble.scalar.Length desiredHeadway, PerceptionIterable<? extends Headway> leaders) throws org.opentrafficsim.base.parameters.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:
org.opentrafficsim.base.parameters.ParameterException
- In case of parameter exception.
-
dynamicDesiredHeadway
protected final org.djunits.value.vdouble.scalar.Length dynamicDesiredHeadway(org.opentrafficsim.base.parameters.Parameters parameters, org.djunits.value.vdouble.scalar.Speed speed, org.djunits.value.vdouble.scalar.Length desiredHeadway, org.djunits.value.vdouble.scalar.Speed leaderSpeed) throws org.opentrafficsim.base.parameters.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:
org.opentrafficsim.base.parameters.ParameterException
- In case of parameter exception.
-
dynamicHeadwayTerm
protected final org.djunits.value.vdouble.scalar.Length dynamicHeadwayTerm(org.opentrafficsim.base.parameters.Parameters parameters, org.djunits.value.vdouble.scalar.Speed speed, org.djunits.value.vdouble.scalar.Speed leaderSpeed) throws org.opentrafficsim.base.parameters.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:
org.opentrafficsim.base.parameters.ParameterException
- In case of parameter exception.
-