Package org.opentrafficsim.road.network
Class Lane
java.lang.Object
org.djutils.event.LocalEventProducer
org.opentrafficsim.road.network.CrossSectionElement
org.opentrafficsim.road.network.Lane
- All Implemented Interfaces:
nl.tudelft.simulation.dsol.animation.Locatable,Identifiable,EventProducer,OtsShape,HierarchicallyTyped<LaneType,Lane>
- Direct Known Subclasses:
Shoulder
The Lane is the CrossSectionElement of a CrossSectionLink on which GTUs can drive. The Lane stores several important
properties, such as the successor lane(s), predecessor lane(s), and adjacent lane(s), all separated per GTU type. It can, for
instance, be that a truck is not allowed to move into an adjacent lane, while a car is allowed to do so. Furthermore, the
lane contains detectors that can be triggered by passing GTUs. The Lane class also contains methods to determine to trigger
the detectors at exactly calculated and scheduled times, given the movement of the GTUs.
Finally, the Lane stores the GTUs on the lane, and contains several access methods to determine successor and predecessor GTUs, as well as methods to add a GTU to a lane (either at the start or in the middle when changing lanes), and remove a GTU from the lane (either at the end, or in the middle when changing onto another lane). The GTU is only booked with its reference point on the lane, and is -- unless during a lane change -- only booked on one lane at a time.
Finally, the Lane stores the GTUs on the lane, and contains several access methods to determine successor and predecessor GTUs, as well as methods to add a GTU to a lane (either at the start or in the middle when changing lanes), and remove a GTU from the lane (either at the end, or in the middle when changing onto another lane). The GTU is only booked with its reference point on the lane, and is -- unless during a lane change -- only booked on one lane at a time.
Copyright (c) 2013-2026 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
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EventTypeThe timed event type for pub/sub indicating the addition of a Detector to the lane.static final EventTypeThe timed event type for pub/sub indicating the removal of a Detector from the lane.static final EventTypeThe timed event type for pub/sub indicating the addition of a GTU to the lane.static final EventTypeThe timed event type for pub/sub indicating the removal of a GTU from the lane.static final org.djunits.value.vdouble.scalar.LengthLateral alignment margin for longitudinally connected Lanes.static final EventTypeThe event type for pub/sub indicating the addition of a LaneBasedObject to the lane.static final EventTypeThe event type for pub/sub indicating the removal of a LaneBasedObject from the lane.Fields inherited from class org.opentrafficsim.road.network.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
ConstructorsConstructorDescriptionLane(CrossSectionLink link, String id, CrossSectionGeometry geometry, LaneType laneType, LaneSpeedLimits laneSpeedLimits) Constructor specifying geometry. -
Method Summary
Modifier and TypeMethodDescriptionaccessibleAdjacentLanesLegal(LateralDirectionality lateralDirection, GtuType gtuType) Determine the set of lanes to the left or to the right of this lane, which are accessible from this lane, or an empty set if no lane could be found.accessibleAdjacentLanesPhysical(LateralDirectionality lateralDirection, GtuType gtuType) Determine the set of lanes to the left or to the right of this lane, which are accessible from this lane, or an empty set if no lane could be found.voidaddDetector(LaneDetector detector) Insert a detector at the right place in the detector list of this Lane.intaddGtu(LaneBasedGtu gtu, double fractionalPosition) Add a LaneBasedGtu to the list of this Lane.intaddGtu(LaneBasedGtu gtu, org.djunits.value.vdouble.scalar.Length longitudinalPosition) Add a LaneBasedGtu to the list of this Lane.voidaddLaneBasedObject(LaneBasedObject laneBasedObject) Insert a laneBasedObject at the right place in the laneBasedObject list of this Lane.org.djunits.value.vdouble.scalar.LengthcoveredDistance(double fraction) Returns the covered distance driven to the given fractional position.booleanvoidforceNextLanes(Set<Lane> lanes) Forces the next lanes to be as specified.voidforcePrevLanes(Set<Lane> lanes) Forces the previous lanes to be as specified.doublefraction(org.djunits.value.vdouble.scalar.Length position) Transform a position on the lane (can be less than zero or larger than the lane length) to a fraction.doublefractionAtCoveredDistance(org.djunits.value.vdouble.scalar.Length distance) Deprecated.doublefractionSI(double positionSI) Transform a position on the lane in SI units (can be less than zero or larger than the lane length) to a fraction.getAdjacentLane(LateralDirectionality laneChangeDirection, GtuType gtuType) Returns one adjacent lane, regardless of legality.getDetectorMap(GtuType gtuType) Retrieve the list of Detectors of this Lane for the given GtuType.Retrieve the list of all Detectors of this Lane.getDetectors(org.djunits.value.vdouble.scalar.Length minimumPosition, org.djunits.value.vdouble.scalar.Length maximumPosition, GtuType gtuType) Retrieve the list of Detectors of this Lane in the specified distance range for the given GtuType.getDetectors(GtuType gtuType) Retrieve the list of Detectors of this Lane that are triggered by the given GtuType.Get the first GTU on the lane, relative to a driving direction on this lane.getGtu(int index) Returns the index'th GTU.getGtu(int index, org.djunits.value.vdouble.scalar.Duration time) Returns the index'th GTU at specified time.getGtuAhead(org.djunits.value.vdouble.scalar.Length position, RelativePosition.Type relativePosition, org.djunits.value.vdouble.scalar.Duration when) Get the first GTU where the relativePosition is in front of another GTU on the lane, in a driving direction on this lane, compared to the DESIGN LINE.getGtuBehind(org.djunits.value.vdouble.scalar.Length position, RelativePosition.Type relativePosition, org.djunits.value.vdouble.scalar.Duration when) Get the first GTU where the relativePosition is behind a certain position on the lane, in a driving direction on this lane, compared to the DESIGN LINE.Returns GTU list.getGtuList(org.djunits.value.vdouble.scalar.Duration time) Returns the list of GTU's at the specified time.Retrieve the list of LaneBasedObjects of this Lane.Retrieve the list of all LaneBasedObjects of this Lane.getLaneBasedObjects(org.djunits.value.vdouble.scalar.Length minimumPosition, org.djunits.value.vdouble.scalar.Length maximumPosition) Retrieve the list of LaneBasedObjects of this Lane in the specified distance range.Get the last GTU on the lane, relative to a driving direction on this lane.Returns the left lane for given GTU type, regardless of legality.getObjectAhead(org.djunits.value.vdouble.scalar.Length position) Get the first object where the relativePosition is in front of a certain position on the lane, in a driving direction on this lane, compared to the DESIGN LINE.getObjectBehind(org.djunits.value.vdouble.scalar.Length position) Get the first object where the relativePosition is behind of a certain position on the lane, in a driving direction on this lane, compared to the DESIGN LINE.Returns the right lane for given GTU type, regardless of legality.Returns the speed limit at the current time-of-day.getSpeedLimit(org.djunits.value.vdouble.scalar.Duration timeOfDay) Returns the speed limit.getSpeedLimits(GtuType gtuType) Get the speed limits of this lane at the current time-of-day, which can differ per GTU type.getSpeedLimits(GtuType gtuType, org.djunits.value.vdouble.scalar.Duration timeOfDay) Get the speed limits of this lane, which can differ per GTU type.getType()inthashCode()intindexOfGtu(LaneBasedGtu gtu) Returns the index of the given GTU, or -1 if not present.NextLanes returns the successor lane(s) in the design line direction, if any exist.
The next lane(s) are cached, as it is too expensive to make the calculation every time.intReturns the number of GTU's.intnumberOfGtus(org.djunits.value.vdouble.scalar.Duration time) Returns the number of GTU's at specified time.org.djunits.value.vdouble.scalar.Lengthposition(double fraction) Transform a fraction on the lane to a relative length (can be less than zero or larger than the lane length).doublepositionSI(double fraction) Transform a fraction on the lane to a relative length in SI units (can be less than zero or larger than the lane length).PrevLanes returns the predecessor lane(s) relative to the design line direction, if any exist.
The previous lane(s) are cached, as it is too expensive to make the calculation every time.org.djunits.value.vdouble.scalar.LengthremainingDistance(double fraction) Returns the remaining distance to be driven from the given fractional position.voidremoveDetector(LaneDetector detector) Remove a detector from the detector list of this Lane.voidremoveGtu(LaneBasedGtu gtu, boolean removeFromParentLink, org.djunits.value.vdouble.scalar.Length position) Remove a GTU from the GTU list of this lane.voidremoveLaneBasedObject(LaneBasedObject laneBasedObject) Remove a laneBasedObject from the laneBasedObject list of this Lane.toString()Methods inherited from class org.opentrafficsim.road.network.CrossSectionElement
getAbsoluteContour, getBeginWidth, getCenterLine, getElevation, getElevation, getEndWidth, getFullId, getGrade, getGrade, getId, getLateralBoundaryPosition, getLateralBoundaryPosition, getLateralCenterPosition, getLateralCenterPosition, getLength, getLink, getLocation, getNetwork, getOffsetAtBegin, getOffsetAtEnd, getRelativeBounds, getRelativeContour, getWidth, getWidth, getZMethods 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
-
Field Details
-
GTU_ADD_EVENT
The timed event type for pub/sub indicating the addition of a GTU to the lane.
Payload: Object[] {String gtuId, int count_after_addition, String laneId, String linkId} -
GTU_REMOVE_EVENT
The timed event type for pub/sub indicating the removal of a GTU from the lane.
Payload: Object[] {String gtuId, LaneBasedGtu gtu, int count_after_removal, Length position, String laneId, String linkId} -
DETECTOR_ADD_EVENT
The timed event type for pub/sub indicating the addition of a Detector to the lane.
Payload: Object[] {String detectorId, Detector detector} -
DETECTOR_REMOVE_EVENT
The timed event type for pub/sub indicating the removal of a Detector from the lane.
Payload: Object[] {String detectorId, Detector detector} -
OBJECT_ADD_EVENT
The event type for pub/sub indicating the addition of a LaneBasedObject to the lane.
Payload: Object[] {LaneBasedObject laneBasedObject} -
OBJECT_REMOVE_EVENT
The event type for pub/sub indicating the removal of a LaneBasedObject from the lane.
Payload: Object[] {LaneBasedObject laneBasedObject} -
MARGIN
public static final org.djunits.value.vdouble.scalar.Length MARGINLateral alignment margin for longitudinally connected Lanes.
-
-
Constructor Details
-
Lane
public Lane(CrossSectionLink link, String id, CrossSectionGeometry geometry, LaneType laneType, LaneSpeedLimits laneSpeedLimits) Constructor specifying geometry.- Parameters:
link- linkid- the id of this lane within the link; should be unique within the linkgeometry- geometrylaneType- lane typelaneSpeedLimits- speed limits
-
-
Method Details
-
addDetector
Insert a detector at the right place in the detector list of this Lane.- Parameters:
detector- the detector to add- Throws:
NetworkException- when the position of the detector is beyond (or before) the range of this Lane
-
removeDetector
Remove a detector from the detector list of this Lane.- Parameters:
detector- the detector to remove.- Throws:
NetworkException- when the detector was not found on this Lane
-
getDetectors
public List<LaneDetector> getDetectors(org.djunits.value.vdouble.scalar.Length minimumPosition, org.djunits.value.vdouble.scalar.Length maximumPosition, GtuType gtuType) Retrieve the list of Detectors of this Lane in the specified distance range for the given GtuType. The resulting list is a defensive copy.- Parameters:
minimumPosition- the minimum distance on the Lane (inclusive)maximumPosition- the maximum distance on the Lane (inclusive)gtuType- the GTU type to provide the detectors for- Returns:
- list of the detectors in the specified range. This is a defensive copy.
-
getDetectors
Retrieve the list of Detectors of this Lane that are triggered by the given GtuType. The resulting list is a defensive copy.- Parameters:
gtuType- the GTU type to provide the detectors for- Returns:
- list of the detectors, in ascending order for the location on the Lane
-
getDetectors
Retrieve the list of all Detectors of this Lane. The resulting list is a defensive copy.- Returns:
- list of the detectors, in ascending order for the location on the Lane
-
getDetectorMap
Retrieve the list of Detectors of this Lane for the given GtuType. The resulting Map is a defensive copy.- Parameters:
gtuType- the GTU type to provide the detectors for- Returns:
- all detectors on this lane for the given GtuType as a map per distance
-
addLaneBasedObject
Insert a laneBasedObject at the right place in the laneBasedObject list of this Lane. Register it in the network WITH the Lane id.- Parameters:
laneBasedObject- the laneBasedObject to add- Throws:
NetworkException- when the position of the laneBasedObject is beyond (or before) the range of this Lane
-
removeLaneBasedObject
Remove a laneBasedObject from the laneBasedObject list of this Lane.- Parameters:
laneBasedObject- the laneBasedObject to remove.- Throws:
NetworkException- when the laneBasedObject was not found on this Lane
-
getLaneBasedObjects
public List<LaneBasedObject> getLaneBasedObjects(org.djunits.value.vdouble.scalar.Length minimumPosition, org.djunits.value.vdouble.scalar.Length maximumPosition) Retrieve the list of LaneBasedObjects of this Lane in the specified distance range. The resulting list is a defensive copy.- Parameters:
minimumPosition- the minimum distance on the Lane (inclusive)maximumPosition- the maximum distance on the Lane (inclusive)- Returns:
- list of the laneBasedObject in the specified range. This is a defensive copy.
-
getLaneBasedObjects
Retrieve the list of all LaneBasedObjects of this Lane. The resulting list is a defensive copy.- Returns:
- list of the laneBasedObjects, in ascending order for the location on the Lane
-
getLaneBasedObjectMap
Retrieve the list of LaneBasedObjects of this Lane. The resulting Map is a defensive copy.- Returns:
- all laneBasedObjects on this lane
-
position
public org.djunits.value.vdouble.scalar.Length position(double fraction) Transform a fraction on the lane to a relative length (can be less than zero or larger than the lane length).- Parameters:
fraction- fraction relative to the lane length.- Returns:
- the longitudinal length corresponding to the fraction.
-
positionSI
public double positionSI(double fraction) Transform a fraction on the lane to a relative length in SI units (can be less than zero or larger than the lane length).- Parameters:
fraction- fraction relative to the lane length.- Returns:
- length corresponding to the fraction, in SI units.
-
fraction
public double fraction(org.djunits.value.vdouble.scalar.Length position) Transform a position on the lane (can be less than zero or larger than the lane length) to a fraction.- Parameters:
position- relative length on the lane (may be less than zero or larger than the lane length).- Returns:
- fraction relative to the lane length.
-
fractionSI
public double fractionSI(double positionSI) Transform a position on the lane in SI units (can be less than zero or larger than the lane length) to a fraction.- Parameters:
positionSI- relative length on the lane in SI units (may be less than zero or larger than the lane length).- Returns:
- fraction relative to the lane length.
-
addGtu
Add a LaneBasedGtu to the list of this Lane.- Parameters:
gtu- the GTU to addfractionalPosition- the fractional position that the newly added GTU will have on this Lane- Returns:
- the rank that the newly added GTU has on this Lane (should be 0, except when the GTU enters this Lane due to a lane change operation)
- Throws:
GtuException- when the GTU is already registered on this Lane
-
addGtu
public int addGtu(LaneBasedGtu gtu, org.djunits.value.vdouble.scalar.Length longitudinalPosition) throws GtuException Add a LaneBasedGtu to the list of this Lane.- Parameters:
gtu- the GTU to addlongitudinalPosition- the longitudinal position that the newly added GTU will have on this Lane- Returns:
- the rank that the newly added GTU has on this Lane (should be 0, except when the GTU enters this Lane due to a lane change operation)
- Throws:
GtuException- when longitudinalPosition is negative or exceeds the length of this Lane
-
removeGtu
public void removeGtu(LaneBasedGtu gtu, boolean removeFromParentLink, org.djunits.value.vdouble.scalar.Length position) Remove a GTU from the GTU list of this lane.- Parameters:
gtu- the GTU to remove.removeFromParentLink- when the GTU leaves the last lane of the parentLink of this Laneposition- last position of the GTU
-
getLastGtu
Get the last GTU on the lane, relative to a driving direction on this lane.- Returns:
- the last GTU on this lane in the given direction, empty if no GTU could be found.
- Throws:
GtuException- when there is a problem with the position of the GTUs on the lane.
-
getFirstGtu
Get the first GTU on the lane, relative to a driving direction on this lane.- Returns:
- the first GTU on this lane in the given direction, empty if no GTU could be found.
- Throws:
GtuException- when there is a problem with the position of the GTUs on the lane.
-
getGtuAhead
public Optional<LaneBasedGtu> getGtuAhead(org.djunits.value.vdouble.scalar.Length position, RelativePosition.Type relativePosition, org.djunits.value.vdouble.scalar.Duration when) Get the first GTU where the relativePosition is in front of another GTU on the lane, in a driving direction on this lane, compared to the DESIGN LINE.- Parameters:
position- the position before which the relative position of a GTU will be searched.relativePosition- RelativePosition.TYPE; the relative position we want to compare againstwhen- the simulation time for which to evaluate the positions.- Returns:
- the first GTU before a position on this lane in the given direction, empty if no GTU could be found.
-
getGtuBehind
public Optional<LaneBasedGtu> getGtuBehind(org.djunits.value.vdouble.scalar.Length position, RelativePosition.Type relativePosition, org.djunits.value.vdouble.scalar.Duration when) Get the first GTU where the relativePosition is behind a certain position on the lane, in a driving direction on this lane, compared to the DESIGN LINE.- Parameters:
position- the position before which the relative position of a GTU will be searched.relativePosition- RelativePosition.TYPE; the relative position of the GTU we are looking for.when- the time for which to evaluate the positions.- Returns:
- the first GTU after a position on this lane in the given direction, empty if no GTU could be found.
-
getObjectAhead
Get the first object where the relativePosition is in front of a certain position on the lane, in a driving direction on this lane, compared to the DESIGN LINE. Perception should iterate over results from this method to see what is most limiting.- Parameters:
position- the position after which the relative position of an object will be searched.- Returns:
- the first object(s) before a position on this lane in the given direction, empty if no object could be found.
-
getObjectBehind
Get the first object where the relativePosition is behind of a certain position on the lane, in a driving direction on this lane, compared to the DESIGN LINE. Perception should iterate over results from this method to see what is most limiting.- Parameters:
position- the position after which the relative position of an object will be searched.- Returns:
- the first object(s) after a position on this lane in the given direction, empty if no object could be found.
-
nextLanes
NextLanes returns the successor lane(s) in the design line direction, if any exist.
The next lane(s) are cached, as it is too expensive to make the calculation every time. There are several possibilities: (1) Returning an empty set when there is no successor lane in the design direction or there is no longitudinal transfer possible to a successor lane in the design direction. (2) Returning a set with just one lane if the lateral position of the successor lane matches the lateral position of this lane (based on an overlap of the lateral positions of the two joining lanes of more than a certain percentage). (3) Multiple lanes in case the Node where the underlying Link for this Lane has multiple "outgoing" Links, and there are multiple lanes that match the lateral position of this lane.
The next lanes can differ per GTU type. For instance, a lane where cars and buses are allowed can have a next lane where only buses are allowed, forcing the cars to leave that lane.- Parameters:
gtuType- the GTU type for which we return the next lanes, usenullto return all next lanes and their design direction- Returns:
- set of Lanes following this lane for the given GTU type.
-
forceNextLanes
Forces the next lanes to be as specified. For specific GTU types, a subset of these lanes is taken.- Parameters:
lanes- lanes to set as next lanes.
-
prevLanes
PrevLanes returns the predecessor lane(s) relative to the design line direction, if any exist.
The previous lane(s) are cached, as it is too expensive to make the calculation every time. There are several possibilities: (1) Returning an empty set when there is no predecessor lane relative to the design direction or there is no longitudinal transfer possible to a predecessor lane relative to the design direction. (2) Returning a set with just one lane if the lateral position of the predecessor lane matches the lateral position of this lane (based on an overlap of the lateral positions of the two joining lanes of more than a certain percentage). (3) Multiple lanes in case the Node where the underlying Link for this Lane has multiple "incoming" Links, and there are multiple lanes that match the lateral position of this lane.
The previous lanes can differ per GTU type. For instance, a lane where cars and buses are allowed can be preceded by a lane where only buses are allowed.- Parameters:
gtuType- the GTU type for which we return the next lanes, usenullto return all prev lanes and their design direction- Returns:
- set of Lanes following this lane for the given GTU type.
-
forcePrevLanes
Forces the previous lanes to be as specified. For specific GTU types, a subset of these lanes is taken.- Parameters:
lanes- lanes to set as previous lanes.
-
accessibleAdjacentLanesPhysical
public Set<Lane> accessibleAdjacentLanesPhysical(LateralDirectionality lateralDirection, GtuType gtuType) Determine the set of lanes to the left or to the right of this lane, which are accessible from this lane, or an empty set if no lane could be found. The method ignores all legal restrictions such as allowable directions and stripes.
A lane is called adjacent to another lane if the lateral edges are not more than a delta distance apart. This means that a lane that overlaps with another lane is not returned as an adjacent lane.
Note: LEFT and RIGHT are seen from the direction of the GTU, in its forward driving direction.- Parameters:
lateralDirection- LEFT or RIGHT.gtuType- the type of GTU for which to return the adjacent lanes.- Returns:
- the set of lanes that are accessible, empty if there is no lane that is accessible with a matching driving direction.
-
accessibleAdjacentLanesLegal
public Set<Lane> accessibleAdjacentLanesLegal(LateralDirectionality lateralDirection, GtuType gtuType) Determine the set of lanes to the left or to the right of this lane, which are accessible from this lane, or an empty set if no lane could be found. The method takes the LongitidinalDirectionality of the lane into account. In other words, if we drive in the DIR_PLUS direction and look for a lane on the LEFT, and there is a lane but the Directionality of that lane is not DIR_PLUS or DIR_BOTH, it will not be included.
A lane is called adjacent to another lane if the lateral edges are not more than a delta distance apart. This means that a lane that overlaps with another lane is not returned as an adjacent lane.
Note: LEFT and RIGHT are seen from the direction of the GTU, in its forward driving direction.- Parameters:
lateralDirection- LEFT or RIGHT.gtuType- the type of GTU for which to return the adjacent lanes.- Returns:
- the set of lanes that are accessible, empty if there is no lane that is accessible with a matching driving direction.
-
getLeft
Returns the left lane for given GTU type, regardless of legality.- Parameters:
gtuType- GTU type- Returns:
- left lane for given GTU type, empty if none
-
getRight
Returns the right lane for given GTU type, regardless of legality.- Parameters:
gtuType- GTU type- Returns:
- right lane for given GTU type, empty if none
-
getAdjacentLane
Returns one adjacent lane, regardless of legality.- Parameters:
laneChangeDirection- lane change directiongtuType- GTU type- Returns:
- adjacent lane, empty if none
-
getSpeedLimits
Get the speed limits of this lane at the current time-of-day, which can differ per GTU type. E.g., a vehicle type speed limit may apply to trucks.- Parameters:
gtuType- the GTU type to provide the speed limits for- Returns:
- speed limits
-
getSpeedLimits
public SpeedLimits getSpeedLimits(GtuType gtuType, org.djunits.value.vdouble.scalar.Duration timeOfDay) Get the speed limits of this lane, which can differ per GTU type. E.g., a vehicle type speed limit may apply to trucks.- Parameters:
gtuType- the GTU type to provide the speed limits fortimeOfDay- time-of-day- Returns:
- speed limits
-
getSpeedLimit
Returns the speed limit at the current time-of-day.- Returns:
- speed limit, empty if no speed limit given
-
getSpeedLimit
Returns the speed limit.- Parameters:
timeOfDay- time-of-day- Returns:
- speed limit, empty if no speed limit given
-
getType
- Specified by:
getTypein interfaceHierarchicallyTyped<LaneType,Lane>
-
getGtuList
Returns GTU list.- Returns:
- gtuList.
-
getGtuList
Returns the list of GTU's at the specified time.- Parameters:
time- simulation time- Returns:
- list of GTU's at the specified times
-
numberOfGtus
public int numberOfGtus()Returns the number of GTU's.- Returns:
- number of GTU's.
-
numberOfGtus
public int numberOfGtus(org.djunits.value.vdouble.scalar.Duration time) Returns the number of GTU's at specified time.- Parameters:
time- simulation time- Returns:
- number of GTU's.
-
indexOfGtu
Returns the index of the given GTU, or -1 if not present.- Parameters:
gtu- gtu to get the index of- Returns:
- index of the given GTU, or -1 if not present
-
getGtu
Returns the index'th GTU.- Parameters:
index- index of the GTU- Returns:
- the index'th GTU
-
getGtu
Returns the index'th GTU at specified time.- Parameters:
index- index of the GTUtime- simulation time- Returns:
- the index'th GTU
-
coveredDistance
public org.djunits.value.vdouble.scalar.Length coveredDistance(double fraction) Returns the covered distance driven to the given fractional position.- Parameters:
fraction- fractional position- Returns:
- covered distance driven to the given fractional position
-
remainingDistance
public org.djunits.value.vdouble.scalar.Length remainingDistance(double fraction) Returns the remaining distance to be driven from the given fractional position.- Parameters:
fraction- fractional position- Returns:
- remaining distance to be driven from the given fractional position
-
fractionAtCoveredDistance
@Deprecated public double fractionAtCoveredDistance(org.djunits.value.vdouble.scalar.Length distance) Deprecated.Returns the fraction along the design line for having covered the given distance.- Parameters:
distance- covered distance- Returns:
- fraction along the design line for having covered the given distance
-
toString
- Overrides:
toStringin classCrossSectionElement
-
hashCode
public int hashCode()- Overrides:
hashCodein classCrossSectionElement
-
equals
- Overrides:
equalsin classCrossSectionElement
-