Class IDMOld

    • Constructor Detail

      • IDMOld

        public IDMOld()
        Construct a new IDM car following model with reasonable values (reasonable for passenger cars).
      • IDMOld

        public IDMOld​(Acceleration a,
                      Acceleration b,
                      Length s0,
                      Duration tSafe,
                      double delta)
        Construct a new IDM car following model.
        Parameters:
        a - Acceleration; the maximum acceleration of a stationary vehicle (normal value is 1.56 m/s/s)
        b - Acceleration; the maximum deemed-safe deceleration (this is a positive value). Normal value is 2.09 m/s/s.
        s0 - Length; the minimum stationary headway (normal value is 3 m)
        tSafe - Duration; the minimum time-headway (normal value is 1.2 s)
        delta - double; the speed limit adherence (1.0; mean free speed equals the speed limit; 1.1: mean free speed equals 110% of the speed limit; etc.)
    • Method Detail

      • computeAcceleration

        public final Acceleration computeAcceleration​(Speed followerSpeed,
                                                      Speed followerMaximumSpeed,
                                                      Speed leaderSpeed,
                                                      Length headway,
                                                      Speed speedLimit)
        Compute the acceleration that would be used to follow a leader.
        Specified by:
        computeAcceleration in interface GTUFollowingModelOld
        Parameters:
        followerSpeed - Speed; the speed of the follower at the current time
        followerMaximumSpeed - Speed; the maximum speed that the follower is capable of driving at
        leaderSpeed - Speed; the speed of the follower at the current time
        headway - Length; the net headway (distance between the front of the follower to the rear of the leader) at the current time, or the maximum distance we can cover at the current time, e.g. as the result of a lane drop
        speedLimit - Speed; the local speed limit
        Returns:
        Acceleration; the acceleration (or, if negative, deceleration) resulting from application of the GTU following model
      • computeAcceleration

        public final Acceleration computeAcceleration​(Speed followerSpeed,
                                                      Speed followerMaximumSpeed,
                                                      Speed leaderSpeed,
                                                      Length headway,
                                                      Speed speedLimit,
                                                      Duration stepSize)
        Compute the acceleration that would be used to follow a leader.
        Specified by:
        computeAcceleration in interface GTUFollowingModelOld
        Parameters:
        followerSpeed - Speed; the speed of the follower at the current time
        followerMaximumSpeed - Speed; the maximum speed that the follower is capable of driving at
        leaderSpeed - Speed; the speed of the follower at the current time
        headway - Length; the net headway (distance between the front of the follower to the rear of the leader) at the current time, or the maximum distance we can cover at the current time, e.g. as the result of a lane drop
        speedLimit - Speed; the local speed limit
        stepSize - Duration; given step size, which can be longer or shorter than the provided step size in the algorithms.
        Returns:
        Acceleration; the acceleration (or, if negative, deceleration) resulting from application of the GTU following model
      • getStepSize

        public final Duration getStepSize()
        Return the standard step size of this GTU following model.
        Specified by:
        getStepSize in interface GTUFollowingModelOld
        Returns:
        Duration; the standard step size of the GTU following model
      • getMaximumSafeDeceleration

        public final Acceleration getMaximumSafeDeceleration()
        Return the maximum safe deceleration for use in gap acceptance models. This is the deceleration that may be enforced upon a new follower due to entering a road or changing into an adjacent lane. The result shall be a positive value. In most car following models this value is named b.
        Specified by:
        getMaximumSafeDeceleration in interface GTUFollowingModelOld
        Returns:
        Acceleration; must be a positive value!
      • getName

        public final String getName()
        Return the name of the car-following model.
        Specified by:
        getName in interface CarFollowingModel
        Returns:
        name of the car-following model
      • getLongName

        public final String getLongName()
        Return the complete name of the car-following model.
        Specified by:
        getLongName in interface CarFollowingModel
        Returns:
        complete name of the car-following model
      • setA

        public final void setA​(Acceleration a)
        Set value of acceleration parameter.
        Specified by:
        setA in interface GTUFollowingModelOld
        Parameters:
        a - Acceleration; value to set
      • setT

        public final void setT​(Duration t)
        Set value of desired headway.
        Specified by:
        setT in interface GTUFollowingModelOld
        Parameters:
        t - Duration; desired headway
      • setFspeed

        public final void setFspeed​(double fSpeed)
        Set value of desired speed factor.
        Specified by:
        setFspeed in interface GTUFollowingModelOld
        Parameters:
        fSpeed - double; desired speed factor
      • desiredSpeed

        public final Speed desiredSpeed​(org.opentrafficsim.base.parameters.Parameters parameters,
                                        SpeedLimitInfo speedInfo)
                                 throws org.opentrafficsim.base.parameters.ParameterException
        Determines the desired speed.
        Specified by:
        desiredSpeed in interface DesiredSpeedModel
        Parameters:
        parameters - Parameters; parameters
        speedInfo - SpeedLimitInfo; info regarding the desired speed for car-following
        Returns:
        desired speed
        Throws:
        org.opentrafficsim.base.parameters.ParameterException - if parameter exception occurs
      • desiredHeadway

        public final Length desiredHeadway​(org.opentrafficsim.base.parameters.Parameters parameters,
                                           Speed speed)
                                    throws org.opentrafficsim.base.parameters.ParameterException
        Determines the desired headway in equilibrium conditions, i.e. no speed difference with the leader.
        Specified by:
        desiredHeadway in interface DesiredHeadwayModel
        Parameters:
        parameters - Parameters; parameters
        speed - Speed; speed to determine the desired headway at
        Returns:
        desired headway
        Throws:
        org.opentrafficsim.base.parameters.ParameterException - if parameter exception occurs
      • followingAcceleration

        public final Acceleration followingAcceleration​(org.opentrafficsim.base.parameters.Parameters parameters,
                                                        Speed speed,
                                                        SpeedLimitInfo speedInfo,
                                                        PerceptionIterable<? extends Headway> leaders)
                                                 throws org.opentrafficsim.base.parameters.ParameterException
        Determination of car-following acceleration, possibly based on multiple leaders. The implementation should be able to deal with:
        • The current speed being higher than the desired speed.
        • The headway being negative.
        Specified by:
        followingAcceleration in interface CarFollowingModel
        Parameters:
        parameters - Parameters; parameters
        speed - Speed; current speed
        speedInfo - SpeedLimitInfo; info regarding the desired speed for car-following
        leaders - PerceptionIterable<? extends Headway>; set of leader headways and speeds, ordered by headway (closest first)
        Returns:
        car-following acceleration
        Throws:
        org.opentrafficsim.base.parameters.ParameterException - if parameter exception occurs