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
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:
-
Field Summary
Fields inherited from class org.opentrafficsim.road.network.lane.CrossSectionElement
link
Fields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITION
-
Constructor Summary
ConstructorsConstructorDescriptionStripe
(String id, StripeData data, CrossSectionLink link, CrossSectionGeometry geometry) Constructor specifying geometry. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPermeability
(GtuType gtuType, LateralDirectionality lateralDirection) Add lateral permeability for a GTU type.org.djunits.value.vdouble.scalar.Length
Returns the dash offset.List<org.opentrafficsim.base.StripeElement>
Returns the elements.org.opentrafficsim.base.StripeElement.StripeLateralSync
Returns the lateral synchronization.org.djutils.draw.line.PolyLine2d
Return link reference line, which is the line halfway between the left-most and right-most stripes.double
Returns the period of the common dash pattern.Returns the phase synchronization.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
setDashOffset
(org.djunits.value.vdouble.scalar.Length dashOffset) Sets the dash offset.void
setLateralSync
(org.opentrafficsim.base.StripeElement.StripeLateralSync lateralSync) Sets the lateral synchronization.void
setPhaseSync
(StripeData.StripePhaseSync phaseSync) Sets the phase synchronization.toString()
Methods inherited from class org.opentrafficsim.road.network.lane.CrossSectionElement
equals, getBeginWidth, getBounds, getCenterLine, getContour, getElevation, getElevation, getEndWidth, getFullId, getGrade, getGrade, getId, getLateralBoundaryPosition, getLateralBoundaryPosition, getLateralCenterPosition, getLateralCenterPosition, getLength, getLink, getLocation, getNetwork, getOffsetAtBegin, getOffsetAtEnd, getShape, getWidth, getWidth, getZ, hashCode
Methods inherited from class org.djutils.event.LocalEventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventListenerMap, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface nl.tudelft.simulation.dsol.animation.Locatable
getDirZ
-
Constructor Details
-
Stripe
Constructor specifying geometry. Permeability is set according to the stripe type default.- Parameters:
id
- iddata
- stripe data, including permeability, stripe elements and dash synchronizationlink
- linkgeometry
- geometry
-
-
Method Details
-
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.
-
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
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
-
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
- Overrides:
toString
in classCrossSectionElement
-