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:
nl.tudelft.simulation.dsol.animation.Locatable,Identifiable,EventProducer,OtsShape,HierarchicallyTyped<LaneType,Lane>
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
-
Field Summary
Fields inherited from class org.opentrafficsim.road.network.lane.Lane
DETECTOR_ADD_EVENT, DETECTOR_REMOVE_EVENT, GTU_ADD_EVENT, GTU_REMOVE_EVENT, MARGIN, OBJECT_ADD_EVENT, OBJECT_REMOVE_EVENTFields inherited from class org.opentrafficsim.road.network.lane.CrossSectionElement
linkFields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITIONFields inherited from interface org.opentrafficsim.base.geometry.OtsShape
DEFAULT_POLYGON_SEGMENTS, WORLD_MARGIN_LINE -
Constructor Summary
ConstructorsConstructorDescriptionShoulder(CrossSectionLink link, String id, CrossSectionGeometry geometry, LaneType laneType) Constructor specifying geometry. -
Method Summary
Modifier and TypeMethodDescriptiongetAdjacentLane(LateralDirectionality laneChangeDirection, GtuType gtuType) Returns one adjacent lane.getSpeedLimit(GtuType gtuType) Get the speed limit of this lane, which can differ per GTU type.doublegetZ()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, getLeft, getLowestSpeedLimit, getObjectAhead, getObjectBehind, getRight, getType, hashCode, indexOfGtu, nextLanes, numberOfGtus, numberOfGtus, position, positionSI, prevLanes, remainingDistance, removeDetector, removeGtu, removeLaneBasedObject, removeSpeedLimit, setSpeedLimit, toStringMethods inherited from class org.opentrafficsim.road.network.lane.CrossSectionElement
getAbsoluteContour, getBeginWidth, getCenterLine, getElevation, getElevation, getEndWidth, getFullId, getGrade, getGrade, getId, getLateralBoundaryPosition, getLateralBoundaryPosition, getLateralCenterPosition, getLateralCenterPosition, getLength, getLink, getLocation, getNetwork, getOffsetAtBegin, getOffsetAtEnd, getRelativeBounds, getRelativeContour, getWidth, getWidthMethods inherited from class org.djutils.event.LocalEventProducer
getEventListenerMapMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListenerMethods inherited from interface org.opentrafficsim.base.HierarchicallyTyped
isOfTypeMethods inherited from interface org.opentrafficsim.base.geometry.OtsShape
contains, contains, getAbsoluteBounds, getAbsoluteContour, getDirZ, signedDistance, signedDistance
-
Constructor Details
-
Shoulder
public Shoulder(CrossSectionLink link, String id, CrossSectionGeometry geometry, LaneType laneType) throws NetworkException Constructor specifying geometry.- Parameters:
link- linkid- the id of this lane within the link; should be unique within the linkgeometry- geometrylaneType- lane type- Throws:
NetworkException- when no cross-section slice is defined
-
-
Method Details
-
getAdjacentLane
Returns one adjacent lane.- Overrides:
getAdjacentLanein classLane- Parameters:
laneChangeDirection- lane change directiongtuType- GTU type.- Returns:
- adjacent lane, empty if none
-
getZ
public double getZ()Description copied from class:CrossSectionElementRetrieve the Z offset (used to determine what covers what when drawing).- Specified by:
getZin interfacenl.tudelft.simulation.dsol.animation.Locatable- Overrides:
getZin classCrossSectionElement- Returns:
- the Z-offset for drawing (what's on top, what's underneath).
-
getSpeedLimit
Description copied from class:LaneGet 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:
getSpeedLimitin classLane- Parameters:
gtuType- the GTU type to provide the speed limit for- Returns:
- the speedLimit.
- Throws:
NetworkException- on network inconsistency
-