Class StripeData
java.lang.Object
org.opentrafficsim.road.network.lane.StripeData
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Method of stripe phase synchronization. -
Constructor Summary
ConstructorsConstructorDescriptionStripeData
(List<org.opentrafficsim.base.StripeElement> elements, boolean left, boolean right) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPermeability
(GtuType gtuType, LateralDirectionality lateralDirection) Add lateral permeability for a GTU type.List<org.opentrafficsim.base.StripeElement>
Returns the elements.org.opentrafficsim.base.StripeElement.StripeLateralSync
Returns the lateral synchronization.double
Returns the period of the common dash pattern.static double
Returns the period after which the given line gap-dash patterns repeat as a whole.Returns the phase synchronization.org.djunits.value.vdouble.scalar.Length
getWidth()
Returns the width, which is the sum of stripe elements.final boolean
isPermeable
(GtuType gtuType, LateralDirectionality lateralDirection) Returns whether the given GTU type is allowed to cross the line in the given lateral direction.void
setElements
(List<org.opentrafficsim.base.StripeElement> elements) Sets the elements.void
setLateralSync
(org.opentrafficsim.base.StripeElement.StripeLateralSync lateralSync) Sets the lateral synchronization.void
setPhaseSync
(StripeData.StripePhaseSync phaseSync) Sets the phase synchronization.
-
Constructor Details
-
StripeData
public StripeData(List<org.opentrafficsim.base.StripeElement> elements, boolean left, boolean right) Constructor.- Parameters:
elements
- list of stripe elementsleft
- left overall permeabilityright
- right overall permeability
-
-
Method Details
-
getElements
Returns the elements.- Returns:
- elements
-
setElements
Sets the elements.- Parameters:
elements
- elements
-
addPermeability
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 forlateralDirection
- direction to add compared to the direction of the design line
-
isPermeable
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
Sets the phase synchronization.- Parameters:
phaseSync
- phase synchronization
-
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
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
-