Class Stripe
- java.lang.Object
-
- org.djutils.event.EventProducer
-
- org.opentrafficsim.road.network.lane.CrossSectionElement
-
- org.opentrafficsim.road.network.lane.RoadMarkerAlong
-
- org.opentrafficsim.road.network.lane.Stripe
-
- All Implemented Interfaces:
Serializable
,Locatable
,EventProducerInterface
,Identifiable
,Drawable
public class Stripe extends RoadMarkerAlong
Longitudinal road stripes; simple constructors.Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.$LastChangedDate: 2015-09-03 13:38:01 +0200 (Thu, 03 Sep 2015) $, @version $Revision: 1378 $, by $Author: averbraeck $, initial version Oct 25, 2014
- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Stripe.Permeable
The types of permeability of a stripe.
-
Field Summary
-
Fields inherited from class org.opentrafficsim.road.network.lane.CrossSectionElement
crossSectionSlices, FIXUPPOINTPROPORTION, length, MAXIMUMDIRECTIONERROR, parentLink
-
Fields inherited from class org.djutils.event.EventProducer
eventProducerImpl
-
Fields inherited from interface org.djutils.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
-
-
Constructor Summary
Constructors Modifier Constructor Description Stripe(CrossSectionLink parentLink, List<CrossSectionSlice> crossSectionSlices, Stripe.Permeable permeable)
Helper constructor that immediately provides permeability for all GTU classes.
Note: LEFT is seen as a positive lateral direction, RIGHT as a negative lateral direction, with the direction from the StartNode towards the EndNode as the longitudinal direction.protected
Stripe(CrossSectionLink newParentLink, SimulatorInterface.TimeDoubleUnit newSimulator, Stripe cse)
Clone a Stripe for a new network.Stripe(CrossSectionLink parentLink, Length lateralCenterPositionStart, Length lateralCenterPositionEnd, Length width)
Note: LEFT is seen as a positive lateral direction, RIGHT as a negative lateral direction, with the direction from the StartNode towards the EndNode as the longitudinal direction.Stripe(CrossSectionLink parentLink, Length lateralCenterPositionStart, Length lateralCenterPositionEnd, Length width, boolean fixGradualLateralOffset)
Note: LEFT is seen as a positive lateral direction, RIGHT as a negative lateral direction, with the direction from the StartNode towards the EndNode as the longitudinal direction.Stripe(CrossSectionLink parentLink, Length lateralCenterPositionStart, Length lateralCenterPositionEnd, Length width, Set<GTUType> gtuTypes, Stripe.Permeable permeable)
Helper constructor that immediately provides permeability for a number of GTU classes.
Note: LEFT is seen as a positive lateral direction, RIGHT as a negative lateral direction, with the direction from the StartNode towards the EndNode as the longitudinal direction.Stripe(CrossSectionLink parentLink, Length lateralCenterPositionStart, Length lateralCenterPositionEnd, Length width, Set<GTUType> gtuTypes, Stripe.Permeable permeable, boolean fixGradualLateralOffset)
Helper constructor that immediately provides permeability for a number of GTU classes.
Note: LEFT is seen as a positive lateral direction, RIGHT as a negative lateral direction, with the direction from the StartNode towards the EndNode as the longitudinal direction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPermeability(GTUType gtuType, Stripe.Permeable permeable)
Stripe
clone(CrossSectionLink newParentLink, SimulatorInterface.TimeDoubleUnit newSimulator)
Clone the CrossSectionElement for e.g., copying a network.String
toString()
-
Methods inherited from class org.opentrafficsim.road.network.lane.RoadMarkerAlong
addPermeability, getPermeabilityMap, getZ, isPermeable
-
Methods inherited from class org.opentrafficsim.road.network.lane.CrossSectionElement
constructContour, equals, getBeginWidth, getBounds, getCenterLine, getContour, getDesignLineOffsetAtBegin, getDesignLineOffsetAtEnd, getEndWidth, getFullId, getId, getLateralBoundaryPosition, getLateralBoundaryPosition, getLateralCenterPosition, getLateralCenterPosition, getLength, getLocation, getNetwork, getParentLink, getSourceId, getWidth, getWidth, hashCode
-
Methods inherited from class org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
-
-
-
-
Constructor Detail
-
Stripe
public Stripe(CrossSectionLink parentLink, Length lateralCenterPositionStart, Length lateralCenterPositionEnd, Length width, boolean fixGradualLateralOffset) throws OTSGeometryException, NetworkException
Note: LEFT is seen as a positive lateral direction, RIGHT as a negative lateral direction, with the direction from the StartNode towards the EndNode as the longitudinal direction.- Parameters:
parentLink
- CrossSectionLink; Cross Section Link to which the element belongslateralCenterPositionStart
- Length; the lateral start position compared to the linear geometry of the Cross Section LinklateralCenterPositionEnd
- Length; the lateral start position compared to the linear geometry of the Cross Section Linkwidth
- Length; positioned <i>symmetrically around</i> the center line given by the lateralCenterPosition.fixGradualLateralOffset
- boolean; true if gradualLateralOffset needs to be fixed- Throws:
OTSGeometryException
- when creation of the center line or contour geometry failsNetworkException
- when id equal to null or not unique
-
Stripe
public Stripe(CrossSectionLink parentLink, Length lateralCenterPositionStart, Length lateralCenterPositionEnd, Length width) throws OTSGeometryException, NetworkException
Note: LEFT is seen as a positive lateral direction, RIGHT as a negative lateral direction, with the direction from the StartNode towards the EndNode as the longitudinal direction.- Parameters:
parentLink
- CrossSectionLink; Cross Section Link to which the element belongslateralCenterPositionStart
- Length; the lateral start position compared to the linear geometry of the Cross Section LinklateralCenterPositionEnd
- Length; the lateral start position compared to the linear geometry of the Cross Section Linkwidth
- Length; positioned <i>symmetrically around</i> the center line given by the lateralCenterPosition.- Throws:
OTSGeometryException
- when creation of the center line or contour geometry failsNetworkException
- when id equal to null or not unique
-
Stripe
public Stripe(CrossSectionLink parentLink, Length lateralCenterPositionStart, Length lateralCenterPositionEnd, Length width, Set<GTUType> gtuTypes, Stripe.Permeable permeable, boolean fixGradualLateralOffset) throws OTSGeometryException, NetworkException
Helper constructor that immediately provides permeability for a number of GTU classes.
Note: LEFT is seen as a positive lateral direction, RIGHT as a negative lateral direction, with the direction from the StartNode towards the EndNode as the longitudinal direction.- Parameters:
parentLink
- CrossSectionLink; Cross Section Link to which the element belongslateralCenterPositionStart
- Length; the lateral start position compared to the linear geometry of the Cross Section LinklateralCenterPositionEnd
- Length; the lateral start position compared to the linear geometry of the Cross Section Linkwidth
- Length; positioned <i>symmetrically around</i> the center line given by the lateralCenterPositiongtuTypes
- Set<GTUType>; the GTU types for which the permeability is definedpermeable
- Permeable; one of the enums of Stripe.Permeable to define the permeabilityfixGradualLateralOffset
- boolean; true if gradualLateralOffset needs to be fixed- Throws:
OTSGeometryException
- when creation of the center line or contour geometry failsNetworkException
- when id equal to null or not unique
-
Stripe
public Stripe(CrossSectionLink parentLink, Length lateralCenterPositionStart, Length lateralCenterPositionEnd, Length width, Set<GTUType> gtuTypes, Stripe.Permeable permeable) throws OTSGeometryException, NetworkException
Helper constructor that immediately provides permeability for a number of GTU classes.
Note: LEFT is seen as a positive lateral direction, RIGHT as a negative lateral direction, with the direction from the StartNode towards the EndNode as the longitudinal direction.- Parameters:
parentLink
- CrossSectionLink; Cross Section Link to which the element belongslateralCenterPositionStart
- Length; the lateral start position compared to the linear geometry of the Cross Section LinklateralCenterPositionEnd
- Length; the lateral start position compared to the linear geometry of the Cross Section Linkwidth
- Length; positioned <i>symmetrically around</i> the center line given by the lateralCenterPositiongtuTypes
- Set<GTUType>; the GTU types for which the permeability is definedpermeable
- Permeable; one of the enums of Stripe.Permeable to define the permeability- Throws:
OTSGeometryException
- when creation of the center line or contour geometry failsNetworkException
- when id equal to null or not unique
-
Stripe
public Stripe(CrossSectionLink parentLink, List<CrossSectionSlice> crossSectionSlices, Stripe.Permeable permeable) throws OTSGeometryException, NetworkException
Helper constructor that immediately provides permeability for all GTU classes.
Note: LEFT is seen as a positive lateral direction, RIGHT as a negative lateral direction, with the direction from the StartNode towards the EndNode as the longitudinal direction.- Parameters:
parentLink
- CrossSectionLink; Cross Section Link to which the element belongscrossSectionSlices
- List<CrossSectionSlice>; The offsets and widths at positions along the line, relative to the design line of the parent link. If there is just one with and offset, there should just be one element in the list with Length = 0. If there are more slices, the last one should be at the length of the design line. If not, a NetworkException is thrown.permeable
- Permeable; one of the enums of Stripe.Permeable to define the permeability- Throws:
OTSGeometryException
- when creation of the center line or contour geometry failsNetworkException
- when id equal to null or not unique
-
Stripe
protected Stripe(CrossSectionLink newParentLink, SimulatorInterface.TimeDoubleUnit newSimulator, Stripe cse) throws NetworkException
Clone a Stripe for a new network.- Parameters:
newParentLink
- CrossSectionLink; the new link to which the clone belongsnewSimulator
- SimulatorInterface.TimeDoubleUnit; the new simulator for this networkcse
- Stripe; the element to clone from- Throws:
NetworkException
- if link already exists in the network, if name of the link is not unique, or if the start node or the end node of the link are not registered in the network.
-
-
Method Detail
-
addPermeability
public final void addPermeability(GTUType gtuType, Stripe.Permeable permeable)
- Parameters:
gtuType
- GTUType; GTU type to add permeability for.permeable
- Permeable; direction(s) to add compared to the direction of the design line.
-
toString
public String toString()
- Overrides:
toString
in classCrossSectionElement
-
clone
public Stripe clone(CrossSectionLink newParentLink, SimulatorInterface.TimeDoubleUnit newSimulator) throws NetworkException
Clone the CrossSectionElement for e.g., copying a network.- Specified by:
clone
in classCrossSectionElement
- Parameters:
newParentLink
- CrossSectionLink; the new link to which the clone belongsnewSimulator
- SimulatorInterface.TimeDoubleUnit; the new simulator for this network- Returns:
- a clone of this object
- Throws:
NetworkException
- in case the cloning fails
-
-