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
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines 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
linkFields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITION -
Constructor Summary
ConstructorsConstructorDescriptionStripe(Stripe.Type type, CrossSectionLink link, OtsLine2d centerLine, org.djutils.draw.line.Polygon2d contour, List<CrossSectionSlice> crossSectionSlices) Constructor specifying geometry. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPermeability(GtuType gtuType, LateralDirectionality lateralDirection) Add lateral permeability for a GTU type in the direction of the design line of the overarching CrossSectionLink.voidClears the overrule type, after which the normal type will hold.getType()Returns the stripe type.final booleanisPermeable(GtuType gtuType, LateralDirectionality lateralDirection) Returns whether the given GTU type is allowed to cross the line in the given lateral direction.voidsetOverruleType(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, toStringMethods 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, removeListenerMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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.
-