Class LmrsUtil

    • Method Detail

      • getLaneChangeDesire

        public static Desire getLaneChangeDesire​(Parameters parameters,
                                                 LanePerception perception,
                                                 CarFollowingModel carFollowingModel,
                                                 Iterable<MandatoryIncentive> mandatoryIncentives,
                                                 Iterable<VoluntaryIncentive> voluntaryIncentives,
                                                 Map<Class<? extends Incentive>,​Desire> desireMap)
                                          throws ParameterException,
                                                 GTUException,
                                                 OperationalPlanException
        Determines lane change desire for the given GtU. Mandatory desire is deduced as the maximum of a set of mandatory incentives, while voluntary desires are added. Depending on the level of mandatory lane change desire, voluntary desire may be included partially. If both are positive or negative, voluntary desire is fully included. Otherwise, voluntary desire is less considered within the range dSync < |mandatory| < dCoop. The absolute value is used as large negative mandatory desire may also dominate voluntary desire.
        Parameters:
        parameters - Parameters; parameters
        perception - LanePerception; perception
        carFollowingModel - CarFollowingModel; car-following model
        mandatoryIncentives - Iterable<MandatoryIncentive>; mandatory incentives
        voluntaryIncentives - Iterable<VoluntaryIncentive>; voluntary incentives
        desireMap - Map<Class<? extends Incentive>,Desire>; map where calculated desires are stored in
        Returns:
        lane change desire for gtu
        Throws:
        ParameterException - if a parameter is not defined
        GTUException - if there is no mandatory incentive, the model requires at least one
        OperationalPlanException - perception exception
      • singleAcceleration

        public static Acceleration singleAcceleration​(Length distance,
                                                      Speed followerSpeed,
                                                      Speed leaderSpeed,
                                                      double desire,
                                                      Parameters params,
                                                      SpeedLimitInfo sli,
                                                      CarFollowingModel cfm)
                                               throws ParameterException
        Determine acceleration from car-following with desire-adjusted headway.
        Parameters:
        distance - Length; distance from follower to leader
        followerSpeed - Speed; speed of follower
        leaderSpeed - Speed; speed of leader
        desire - double; level of lane change desire
        params - Parameters; parameters
        sli - SpeedLimitInfo; speed limit info
        cfm - CarFollowingModel; car-following model
        Returns:
        acceleration from car-following
        Throws:
        ParameterException - if a parameter is not defined