Class SpeedLimitUtil

java.lang.Object
org.opentrafficsim.road.gtu.lane.tactical.util.SpeedLimitUtil

public final class SpeedLimitUtil
extends java.lang.Object
Static methods regarding speed limits for composition in tactical planners.

Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Version:
$Revision$, $LastChangedDate$, by $Author$, initial version May 20, 2016
Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
  • Field Details

  • Method Details

    • getLegalSpeedLimit

      public static Speed getLegalSpeedLimit​(SpeedLimitInfo speedLimitInfo)
      Returns the minimum speed of the applicable speed limit types MAX_LEGAL_VEHICLE_SPEED, ROAD_CLASS, FIXED_SIGN and DYNAMIC_SIGN. ROAD_CLASS is only used if FIXED_SIGN and DYNAMIC_SIGN are not present. This method may be overridden by subclasses to implement additional behavior regarding legal speed limits.
      Parameters:
      speedLimitInfo - SpeedLimitInfo; speed limit info
      Returns:
      minimum of speed of speed limit types
      Throws:
      java.lang.NullPointerException - if speed limit info is null
    • getMaximumVehicleSpeed

      public static Speed getMaximumVehicleSpeed​(SpeedLimitInfo speedLimitInfo)
      Returns the speed of speed limit type MAX_VEHICLE_SPEED. This method may be overridden by subclasses to implement additional behavior regarding maximum vehicle speed limits.
      Parameters:
      speedLimitInfo - SpeedLimitInfo; speed limit info
      Returns:
      speed of speed limit type MAX_VEHICLE_SPEED
      Throws:
      java.lang.NullPointerException - if speed limit info is null
    • considerSpeedLimitTransitions

      public static Acceleration considerSpeedLimitTransitions​(Parameters parameters, Speed speed, SpeedLimitProspect speedLimitProspect, CarFollowingModel carFollowingModel) throws ParameterException
      Acceleration for speed limit transitions. This implementation decelerates before curves and speed bumps. For this it uses approachTargetSpeed() of the abstract car-following model implementation. All remaining transitions happen in the default manner, i.e. deceleration and acceleration after the speed limit change and governed by the car-following model.
      Parameters:
      parameters - Parameters; parameters
      speed - Speed; current speed
      speedLimitProspect - SpeedLimitProspect; speed limit prospect
      carFollowingModel - CarFollowingModel; car following model
      Returns:
      acceleration for speed limit transitions
      Throws:
      ParameterException - if a required parameter is not found