Class Stripe

java.lang.Object
org.djutils.event.LocalEventProducer
org.opentrafficsim.road.network.lane.CrossSectionElement
org.opentrafficsim.road.network.lane.Stripe
All Implemented Interfaces:
Serializable, Remote, nl.tudelft.simulation.dsol.animation.Locatable, org.djutils.base.Identifiable, org.djutils.event.EventProducer, org.opentrafficsim.base.geometry.OtsLocatable, org.opentrafficsim.base.geometry.SpatialObject

public class Stripe extends CrossSectionElement
Stripe road marking. This class only contains functional information. There is no information on how to draw the stripe, i.e. no color and no information on dashes. The stripe types has information on this, but this only serves as a default towards classes that do draw a stripe.

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:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
See Also:
  • Constructor Details

    • Stripe

      public Stripe(String id, StripeData data, CrossSectionLink link, CrossSectionGeometry geometry)
      Constructor specifying geometry. Permeability is set according to the stripe type default.
      Parameters:
      id - id
      data - stripe data, including permeability, stripe elements and dash synchronization
      link - link
      geometry - geometry
  • Method Details

    • 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.
    • getElements

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

      public void setDashOffset(org.djunits.value.vdouble.scalar.Length dashOffset)
      Sets the dash offset.
      Parameters:
      dashOffset - dash offset
    • getDashOffset

      public org.djunits.value.vdouble.scalar.Length getDashOffset()
      Returns the dash offset.
      Returns:
      dash offset
    • 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
    • getLinkReferenceLine

      public org.djutils.draw.line.PolyLine2d getLinkReferenceLine()
      Return link reference line, which is the line halfway between the left-most and right-most stripes.
      Returns:
      link reference line
    • toString

      public String toString()
      Overrides:
      toString in class CrossSectionElement