Class StripeData

java.lang.Object
org.opentrafficsim.road.network.lane.StripeData

public class StripeData extends Object
Container for data about stripes, independent from the link and curvature.

Copyright (c) 2024-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
  • Constructor Details

    • StripeData

      public StripeData(List<org.opentrafficsim.base.StripeElement> elements, boolean left, boolean right)
      Constructor.
      Parameters:
      elements - list of stripe elements
      left - left overall permeability
      right - right overall permeability
  • Method Details

    • getElements

      public List<org.opentrafficsim.base.StripeElement> getElements()
      Returns the elements.
      Returns:
      elements
    • setElements

      public void setElements(List<org.opentrafficsim.base.StripeElement> elements)
      Sets the elements.
      Parameters:
      elements - elements
    • addPermeability

      public void addPermeability(GtuType gtuType, LateralDirectionality lateralDirection)
      Add lateral permeability for a GTU type. This overrules overall stripe permeability. Add NONE to prevent lane changes. Add both LEFT and RIGHT in two calls, to enable lane changes. Add LEFT or RIGHT to enable one direction while prohibiting the other.
      Parameters:
      gtuType - GTU type to add permeability for
      lateralDirection - direction to add compared to the direction of the design line
    • isPermeable

      public final boolean isPermeable(GtuType gtuType, LateralDirectionality lateralDirection)
      Returns whether the given GTU type is allowed to cross the line in the given lateral direction.
      Parameters:
      gtuType - GTU type to look for.
      lateralDirection - direction to look for (LEFT or RIGHT) compared to the direction of the design line.
      Returns:
      whether the road marker is permeable for the GTU type.
    • setLateralSync

      public void setLateralSync(org.opentrafficsim.base.StripeElement.StripeLateralSync lateralSync)
      Sets the lateral synchronization.
      Parameters:
      lateralSync - lateral synchronization
    • getLateralSync

      public org.opentrafficsim.base.StripeElement.StripeLateralSync getLateralSync()
      Returns the lateral synchronization.
      Returns:
      lateral synchronization
    • setPhaseSync

      public void setPhaseSync(StripeData.StripePhaseSync phaseSync)
      Sets the phase synchronization.
      Parameters:
      phaseSync - phase synchronization
    • getPhaseSync

      public StripeData.StripePhaseSync getPhaseSync()
      Returns the phase synchronization.
      Returns:
      phase synchronization
    • getPeriod

      public double getPeriod()
      Returns the period of the common dash pattern.
      Returns:
      period of the common dash pattern
    • getPeriod

      public static double getPeriod(List<org.opentrafficsim.base.StripeElement> elements)
      Returns the period after which the given line gap-dash patterns repeat as a whole. Lengths are rounded to a precision of 0.0001 to find the greatest common divisor.
      Parameters:
      elements - elements
      Returns:
      period
    • getWidth

      public org.djunits.value.vdouble.scalar.Length getWidth()
      Returns the width, which is the sum of stripe elements.
      Returns:
      width