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, Drawable

public class Stripe extends CrossSectionElement

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(Stripe.Type type, CrossSectionLink link, OtsLine2d centerLine, org.djutils.draw.line.Polygon2d contour, List<CrossSectionSlice> crossSectionSlices) throws NetworkException
      Constructor specifying geometry.
      Parameters:
      type - Type; stripe type defining appearance and default permeability.
      link - CrossSectionLink; link.
      centerLine - OtsLine2d; center line.
      contour - Polygon2d; contour shape.
      crossSectionSlices - List<CrossSectionSlice>; cross-section slices.
      Throws:
      NetworkException - when no cross-section slice is defined.
  • Method Details

    • getType

      public Stripe.Type getType()
      Returns the stripe type.
      Returns:
      Type; stripe type.
    • setOverruleType

      public void setOverruleType(Stripe.Type overruleType)
      Sets an overruling stripe type. This can be used for e.g. rush-hour lanes, without changing the appearance of the stripe. Note that custom set permeabilities (addPermeability()) remain active.
      Parameters:
      overruleType - Type; overruling stripe type.
    • clearOverruleType

      public void clearOverruleType()
      Clears the overrule type, after which the normal type will hold.
    • addPermeability

      public void addPermeability(GtuType gtuType, LateralDirectionality lateralDirection)
      Add lateral permeability for a GTU type in the direction of the design line of the overarching CrossSectionLink. Add NONE to prevent lane changes relative to the stripe type. Add LEFT or RIGHT, or both in two calls, to enable lane changes relative to the stripe type.
      Parameters:
      gtuType - GtuType; GTU type to add permeability for.
      lateralDirection - LateralDirectionality; 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 - GtuType; GTU type to look for.
      lateralDirection - LateralDirectionality; 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.