Class Shoulder
java.lang.Object
org.djutils.event.LocalEventProducer
org.opentrafficsim.road.network.lane.CrossSectionElement
org.opentrafficsim.road.network.lane.Lane
org.opentrafficsim.road.network.lane.Shoulder
- 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.HierarchicallyTyped<LaneType,
,Lane> Drawable
,SpatialObject
This class is mostly the same as a Lane. But as a shoulder it can be recognized by algorithms and models to be responded to
differently.
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
- See Also:
-
Field Summary
Fields inherited from class org.opentrafficsim.road.network.lane.Lane
ADJACENT_MARGIN, DETECTOR_ADD_EVENT, DETECTOR_REMOVE_EVENT, GTU_ADD_EVENT, GTU_REMOVE_EVENT, MARGIN, OBJECT_ADD_EVENT, OBJECT_REMOVE_EVENT
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
ConstructorDescriptionShoulder
(CrossSectionLink link, String id, OtsLine2d centerLine, org.djutils.draw.line.Polygon2d contour, List<CrossSectionSlice> crossSectionSlices, LaneType laneType) Constructor specifying geometry. -
Method Summary
Modifier and TypeMethodDescriptiongetAdjacentLane
(LateralDirectionality laneChangeDirection, GtuType gtuType) Returns one adjacent lane.org.djunits.value.vdouble.scalar.Speed
getSpeedLimit
(GtuType gtuType) Get the speed limit of this lane, which can differ per GTU type.double
getZ()
Retrieve the Z offset (used to determine what covers what when drawing).Methods inherited from class org.opentrafficsim.road.network.lane.Lane
accessibleAdjacentLanesLegal, accessibleAdjacentLanesPhysical, addDetector, addGtu, addGtu, addLaneBasedObject, coveredDistance, equals, forceNextLanes, forcePrevLanes, fraction, fractionAtCoveredDistance, fractionSI, getDetectorMap, getDetectors, getDetectors, getDetectors, getFirstGtu, getGtu, getGtu, getGtuAhead, getGtuBehind, getGtuList, getGtuList, getHighestSpeedLimit, getLaneBasedObjectMap, getLaneBasedObjects, getLaneBasedObjects, getLastGtu, getLowestSpeedLimit, getObjectAhead, getObjectBehind, getShape, getType, hashCode, indexOfGtu, indexOfGtu, nextLanes, numberOfGtus, numberOfGtus, position, positionSI, prevLanes, remainingDistance, removeDetector, removeGtu, removeLaneBasedObject, removeSpeedLimit, scheduleDetectorTriggers, setSpeedLimit, toString
Methods inherited from class org.opentrafficsim.road.network.lane.CrossSectionElement
getBeginWidth, getBounds, getCenterLine, getContour, getElevation, getElevation, getEndWidth, getFullId, getGrade, getGrade, getId, getLateralBoundaryPosition, getLateralBoundaryPosition, getLateralCenterPosition, getLateralCenterPosition, getLength, getLink, getLocation, getNetwork, getOffsetAtBegin, getOffsetAtEnd, getWidth, getWidth
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 org.opentrafficsim.base.HierarchicallyTyped
isOfType
Methods inherited from interface nl.tudelft.simulation.dsol.animation.Locatable
getDirZ
-
Constructor Details
-
Shoulder
public Shoulder(CrossSectionLink link, String id, OtsLine2d centerLine, org.djutils.draw.line.Polygon2d contour, List<CrossSectionSlice> crossSectionSlices, LaneType laneType) throws NetworkException Constructor specifying geometry.- Parameters:
link
- CrossSectionLink; link.id
- String; the id of this lane within the link; should be unique within the link.centerLine
- OtsLine2d; center line.contour
- Polygon2d; contour shape.crossSectionSlices
- List<CrossSectionSlice>; cross-section slices.laneType
- LaneType; lane type.- Throws:
NetworkException
- when no cross-section slice is defined.
-
-
Method Details
-
getAdjacentLane
Returns one adjacent lane.- Overrides:
getAdjacentLane
in classLane
- Parameters:
laneChangeDirection
- LateralDirectionality; lane change directiongtuType
- GtuType; GTU type.- Returns:
- Lane; adjacent lane,
null
if none
-
getZ
public double getZ()Retrieve the Z offset (used to determine what covers what when drawing).- Specified by:
getZ
in interfacenl.tudelft.simulation.dsol.animation.Locatable
- Overrides:
getZ
in classCrossSectionElement
- Returns:
- double; the Z-offset for drawing (what's on top, what's underneath).
-
getSpeedLimit
public org.djunits.value.vdouble.scalar.Speed getSpeedLimit(GtuType gtuType) throws NetworkException Get the speed limit of this lane, which can differ per GTU type. E.g., cars might be allowed to drive 120 km/h and trucks 90 km/h.- Overrides:
getSpeedLimit
in classLane
- Parameters:
gtuType
- GtuType; the GTU type to provide the speed limit for- Returns:
- the speedLimit.
- Throws:
NetworkException
- on network inconsistency
-