Class AbstractCarFollowingModel

    • Constructor Detail

      • AbstractCarFollowingModel

        public AbstractCarFollowingModel​(DesiredHeadwayModel desiredHeadwayModel,
                                         DesiredSpeedModel desiredSpeedModel)
        Parameters:
        desiredHeadwayModel - DesiredHeadwayModel; desired headway model
        desiredSpeedModel - DesiredSpeedModel; desired speed model
    • Method Detail

      • desiredHeadway

        public final Length desiredHeadway​(Parameters parameters,
                                           Speed speed)
                                    throws 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:
        ParameterException - if parameter exception occurs
      • followingAcceleration

        public final Acceleration followingAcceleration​(Parameters parameters,
                                                        Speed speed,
                                                        SpeedLimitInfo speedLimitInfo,
                                                        PerceptionIterable<? extends Headway> leaders)
                                                 throws 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
        speedLimitInfo - 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:
        ParameterException - if parameter exception occurs
      • followingAcceleration

        protected abstract 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.
        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