Class AbstractIDM

    • Constructor Detail

      • 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 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 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:
        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.