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_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

    Fields
    Modifier and Type
    Field
    Description
    protected 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

    Constructors
    Constructor
    Description
    AbstractIdm(DesiredHeadwayModel desiredHeadwayModel, DesiredSpeedModel desiredSpeedModel)
    Constructor with modular models for desired headway and desired speed.
  • Method Summary

    Modifier and Type
    Method
    Description
    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)
    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 A
      Acceleration parameter type.
    • B

      protected static final org.opentrafficsim.base.parameters.ParameterTypeAcceleration B
      Comfortable deceleration parameter type.
    • T

      protected static final org.opentrafficsim.base.parameters.ParameterTypeDuration T
      Desired headway parameter type.
    • S0

      protected static final org.opentrafficsim.base.parameters.ParameterTypeLength S0
      Stopping distance parameter type.
    • B0

      protected static final org.opentrafficsim.base.parameters.ParameterTypeAcceleration B0
      Adjustment deceleration parameter type.
    • FSPEED

      protected static final org.opentrafficsim.base.parameters.ParameterTypeDouble FSPEED
      Speed limit adherence factor parameter type.
    • DELTA

      public static final org.opentrafficsim.base.parameters.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 Details

    • AbstractIdm

      public AbstractIdm(DesiredHeadwayModel desiredHeadwayModel, DesiredSpeedModel desiredSpeedModel)
      Constructor with modular models for desired headway and desired speed.
      Parameters:
      desiredHeadwayModel - DesiredHeadwayModel; desired headway model
      desiredSpeedModel - 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 leaders combineInteractionTerm() is invoked to combine the free term with some implementation specific interaction term. The IDM free term is limited by a deceleration of B0 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 class AbstractCarFollowingModel
      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.