Class TrafficLightUtil

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

public final class TrafficLightUtil extends Object
Static methods regarding traffic lights for composition in tactical planners.

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

Author:
Wouter Schakel
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.opentrafficsim.base.parameters.ParameterTypeAcceleration
    Maximum deceleration for stopping for yellow traffic light.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.djunits.value.vdouble.scalar.Acceleration
    respondToTrafficLight(org.opentrafficsim.base.parameters.Parameters parameters, HeadwayTrafficLight headwayTrafficLight, CarFollowingModel carFollowingModel, org.djunits.value.vdouble.scalar.Speed speed, SpeedLimitInfo speedLimitInfo)
    Returns an acceleration as response to a traffic light, being positive infinity if ignored.
    static org.djunits.value.vdouble.scalar.Acceleration
    respondToTrafficLights(org.opentrafficsim.base.parameters.Parameters parameters, Iterable<HeadwayTrafficLight> headwayTrafficLights, CarFollowingModel carFollowingModel, org.djunits.value.vdouble.scalar.Speed speed, SpeedLimitInfo speedLimitInfo)
    Returns an acceleration as response to a set of traffic lights, being positive infinity if ignored.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • BCRIT

      public static final org.opentrafficsim.base.parameters.ParameterTypeAcceleration BCRIT
      Maximum deceleration for stopping for yellow traffic light.
  • Method Details

    • respondToTrafficLights

      public static org.djunits.value.vdouble.scalar.Acceleration respondToTrafficLights(org.opentrafficsim.base.parameters.Parameters parameters, Iterable<HeadwayTrafficLight> headwayTrafficLights, CarFollowingModel carFollowingModel, org.djunits.value.vdouble.scalar.Speed speed, SpeedLimitInfo speedLimitInfo) throws org.opentrafficsim.base.parameters.ParameterException
      Returns an acceleration as response to a set of traffic lights, being positive infinity if ignored. The response is governed by the car-following model in case a traffic light is yellow or red. A constant deceleration to stop is also calculated, and the highest acceleration of both is used. If this value is below -bYellow (B_YELLOW), the traffic light is ignored, which usually occurs only during the yellow phase. By using the highest acceleration of the car-following model and the constant deceleration, it is ensured that comfortable deceleration is applied if approaching a red traffic light from far away, while strong deceleration is only applied if required and appropriately represents stopping for yellow.
      Parameters:
      parameters - Parameters; parameters
      headwayTrafficLights - Iterable<HeadwayTrafficLight>; set of headway traffic lights
      carFollowingModel - CarFollowingModel; car following model
      speed - Speed; speed
      speedLimitInfo - SpeedLimitInfo; speed limit info
      Returns:
      acceleration as response to a traffic light, being positive infinity if ignored
      Throws:
      org.opentrafficsim.base.parameters.ParameterException - if a parameter is not defined
      NullPointerException - if any input is null
      IllegalArgumentException - if the traffic light is not downstream
    • respondToTrafficLight

      public static org.djunits.value.vdouble.scalar.Acceleration respondToTrafficLight(org.opentrafficsim.base.parameters.Parameters parameters, HeadwayTrafficLight headwayTrafficLight, CarFollowingModel carFollowingModel, org.djunits.value.vdouble.scalar.Speed speed, SpeedLimitInfo speedLimitInfo) throws org.opentrafficsim.base.parameters.ParameterException
      Returns an acceleration as response to a traffic light, being positive infinity if ignored. The response is governed by the car-following model in case the traffic light is yellow or red. A constant deceleration to stop is also calculated, and the highest acceleration of both is used. If this value is below -bYellow (B_YELLOW), the traffic light is ignored, which usually occurs only during the yellow phase. By using the highest acceleration of the car-following model and the constant deceleration, it is ensured that comfortable deceleration is applied if approaching a red traffic light from far away, while strong deceleration is only applied if required and appropriately represents stopping for yellow.
      Parameters:
      parameters - Parameters; parameters
      headwayTrafficLight - HeadwayTrafficLight; headway traffic light
      carFollowingModel - CarFollowingModel; car following model
      speed - Speed; speed
      speedLimitInfo - SpeedLimitInfo; speed limit info
      Returns:
      acceleration as response to a traffic light, being positive infinity if ignored
      Throws:
      org.opentrafficsim.base.parameters.ParameterException - if a parameter is not defined
      NullPointerException - if any input is null
      IllegalArgumentException - if the traffic light is not downstream