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
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:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Defines the visible type of the stripe, and the standard permeability that pertains to it. -
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
ConstructorDescriptionStripe
(Stripe.Type type, CrossSectionLink link, OtsLine2d centerLine, org.djutils.draw.line.Polygon2d contour, List<CrossSectionSlice> crossSectionSlices) Constructor specifying geometry. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPermeability
(GtuType gtuType, LateralDirectionality lateralDirection) Add lateral permeability for a GTU type in the direction of the design line of the overarching CrossSectionLink.void
Clears the overrule type, after which the normal type will hold.getType()
Returns the stripe type.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
setOverruleType
(Stripe.Type overruleType) Sets an overruling stripe type.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, getWidth, getWidth, getZ, hashCode, toString
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
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
Returns the stripe type.- Returns:
- Type; stripe type.
-
setOverruleType
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
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
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.
-