public class Lane extends CrossSectionElement implements Serializable
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2015-09-24 14:17:07 +0200 (Thu, 24 Sep 2015) $, @version $Revision: 1407 $, by $Author: averbraeck $,
initial version Aug 19, 2014
Modifier and Type | Field and Description |
---|---|
static EventType |
GTU_ADD_EVENT
The timed event type for pub/sub indicating the addition of a GTU to the lane.
|
static EventType |
GTU_REMOVE_EVENT
The timed event type for pub/sub indicating the removal of a GTU from the lane.
|
static Length |
MARGIN
Lateral alignment margin for longitudinally connected Lanes.
|
static EventType |
OBJECT_ADD_EVENT
The event type for pub/sub indicating the addition of a LaneBasedObject to the lane.
|
static EventType |
OBJECT_REMOVE_EVENT
The event type for pub/sub indicating the removal of a LaneBasedObject from the lane.
|
static EventType |
SENSOR_ADD_EVENT
The timed event type for pub/sub indicating the addition of a Sensor to the lane.
|
static EventType |
SENSOR_REMOVE_EVENT
The timed event type for pub/sub indicating the removal of a Sensor from the lane.
|
crossSectionSlices, length, parentLink
listeners
FIRST_POSITION, LAST_POSITION
Modifier | Constructor and Description |
---|---|
protected |
Lane(CrossSectionLink newParentLink,
SimulatorInterface.TimeDoubleUnit newSimulator,
Lane cse)
Clone a Lane for a new network.
|
|
Lane(CrossSectionLink parentLink,
String id,
Length lateralOffset,
Length width,
LaneType laneType,
Map<GTUType,Speed> speedLimitMap,
OvertakingConditions overtakingConditions)
Construct a new Lane.
|
|
Lane(CrossSectionLink parentLink,
String id,
Length lateralOffset,
Length width,
LaneType laneType,
Speed speedLimit,
OvertakingConditions overtakingConditions)
Construct a new Lane.
|
|
Lane(CrossSectionLink parentLink,
String id,
Length lateralOffsetAtStart,
Length lateralOffsetAtEnd,
Length beginWidth,
Length endWidth,
LaneType laneType,
Map<GTUType,Speed> speedLimitMap,
OvertakingConditions overtakingConditions)
Construct a new Lane.
|
|
Lane(CrossSectionLink parentLink,
String id,
Length lateralOffsetAtStart,
Length lateralOffsetAtEnd,
Length beginWidth,
Length endWidth,
LaneType laneType,
Speed speedLimit,
OvertakingConditions overtakingConditions)
Construct a new Lane.
|
|
Lane(CrossSectionLink parentLink,
String id,
List<CrossSectionSlice> crossSectionSlices,
LaneType laneType,
Map<GTUType,Speed> speedLimitMap,
OvertakingConditions overtakingConditions)
Construct a new Lane.
|
|
Lane(CrossSectionLink parentLink,
String id,
List<CrossSectionSlice> crossSectionSlices,
LaneType laneType,
Speed speedLimit,
OvertakingConditions overtakingConditions)
Construct a new Lane.
|
Modifier and Type | Method and Description |
---|---|
Set<Lane> |
accessibleAdjacentLanesLegal(LateralDirectionality lateralDirection,
GTUType gtuType,
GTUDirectionality drivingDirection)
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.
|
Set<Lane> |
accessibleAdjacentLanesPhysical(LateralDirectionality lateralDirection,
GTUType gtuType,
GTUDirectionality drivingDirection)
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.
|
int |
addGTU(LaneBasedGTU gtu,
double fractionalPosition)
Add a LaneBasedGTU to the list of this Lane.
|
int |
addGTU(LaneBasedGTU gtu,
Length longitudinalPosition)
Add a LaneBasedGTU to the list of this Lane.
|
void |
addLaneBasedObject(LaneBasedObject laneBasedObject)
Insert a laneBasedObject at the right place in the laneBasedObject list of this Lane.
|
void |
addSensor(SingleSensor sensor)
Insert a sensor at the right place in the sensor list of this Lane.
|
Lane |
clone(CrossSectionLink newParentLink,
SimulatorInterface.TimeDoubleUnit newSimulator)
Clone the CrossSectionElement for e.g., copying a network.
|
Map<Lane,GTUDirectionality> |
downstreamLanes(GTUDirectionality direction,
GTUType gtuType)
Returns the lanes that could be followed in a given direction and for the given GTU type.
|
boolean |
equals(Object obj) |
double |
fraction(Length position)
Transform a position on the lane (can be less than zero or larger than the lane length) to a fraction.
|
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.
|
LaneBasedGTU |
getFirstGtu(GTUDirectionality direction)
Get the first GTU on the lane, relative to a driving direction on this lane.
|
LaneBasedGTU |
getGtu(int index)
Returns the index'th GTU.
|
LaneBasedGTU |
getGtu(int index,
Time time)
Returns the index'th GTU at specified time.
|
LaneBasedGTU |
getGtuAhead(Length position,
GTUDirectionality direction,
RelativePosition.TYPE relativePosition,
Time 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.
|
LaneBasedGTU |
getGtuBehind(Length position,
GTUDirectionality direction,
RelativePosition.TYPE relativePosition,
Time 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.
|
ImmutableList<LaneBasedGTU> |
getGtuList() |
List<LaneBasedGTU> |
getGtuList(Time time)
Returns the list of GTU's at the specified time.
|
Speed |
getHighestSpeedLimit()
Get the highest speed limit of this lane.
|
SortedMap<Double,List<LaneBasedObject>> |
getLaneBasedObjectMap()
Retrieve the list of LaneBasedObjects of this Lane.
|
List<LaneBasedObject> |
getLaneBasedObjects()
Retrieve the list of all LaneBasedObjects of this Lane.
|
List<LaneBasedObject> |
getLaneBasedObjects(Length minimumPosition,
Length maximumPosition)
Retrieve the list of LaneBasedObjects of this Lane in the specified distance range.
|
LaneType |
getLaneType() |
LaneBasedGTU |
getLastGtu(GTUDirectionality direction)
Get the last GTU on the lane, relative to a driving direction on this lane.
|
Speed |
getLowestSpeedLimit()
Get the lowest speed limit of this lane.
|
List<LaneBasedObject> |
getObjectAhead(Length position,
GTUDirectionality direction)
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.
|
List<LaneBasedObject> |
getObjectBehind(Length position,
GTUDirectionality direction)
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.
|
OvertakingConditions |
getOvertakingConditions() |
SortedMap<Double,List<SingleSensor>> |
getSensorMap(GTUType gtuType,
GTUDirectionality direction)
Retrieve the list of Sensors of this Lane for the given GTUType.
|
List<SingleSensor> |
getSensors()
Retrieve the list of all Sensors of this Lane.
|
List<SingleSensor> |
getSensors(GTUType gtuType,
GTUDirectionality direction)
Retrieve the list of Sensors of this Lane that are triggered by the given GTUType.
|
List<SingleSensor> |
getSensors(Length minimumPosition,
Length maximumPosition,
GTUType gtuType,
GTUDirectionality direction)
Retrieve the list of Sensors of this Lane in the specified distance range for the given GTUType.
|
Speed |
getSpeedLimit(GTUType gtuType)
Get the speed limit of this lane, which can differ per GTU type.
|
protected double |
getZ()
Retrieve the Z offset (used to determine what covers what when drawing).
|
int |
hashCode() |
int |
indexOfGtu(LaneBasedGTU gtu)
Returns the index of the given GTU, or -1 if not present.
|
int |
indexOfGtu(LaneBasedGTU gtu,
Time time)
Returns the index of the given GTU, or -1 if not present, at specified time.
|
Map<Lane,GTUDirectionality> |
nextLanes(GTUType gtuType)
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. |
int |
numberOfGtus()
Returns the number of GTU's.
|
int |
numberOfGtus(Time time)
Returns the number of GTU's at specified time.
|
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).
|
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).
|
Map<Lane,GTUDirectionality> |
prevLanes(GTUType gtuType)
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. |
void |
removeGTU(LaneBasedGTU gtu,
boolean removeFromParentLink,
Length position)
Remove a GTU from the GTU list of this lane.
|
void |
removeLaneBasedObject(LaneBasedObject laneBasedObject)
Remove a laneBasedObject from the laneBasedObject list of this Lane.
|
void |
removeSensor(SingleSensor sensor)
Remove a sensor from the sensor list of this Lane.
|
void |
removeSpeedLimit(GTUType gtuType)
Remove the set speed limit for a GTUType.
|
void |
scheduleSensorTriggers(LaneBasedGTU gtu,
double referenceStartSI,
double referenceMoveSI)
Schedule triggering of the sensors for a certain time step; from now until the nextEvaluationTime of the GTU.
|
void |
setSpeedLimit(GTUType gtuType,
Speed speedLimit)
Set the speed limit of this lane, which can differ per GTU type.
|
String |
toString() |
Map<Lane,GTUDirectionality> |
upstreamLanes(GTUDirectionality direction,
GTUType gtuType)
Returns the lanes that could precede in a given direction and for the given GTU type.
|
constructContour, getBeginWidth, getBounds, getCenterLine, getContour, getDesignLineOffsetAtBegin, getDesignLineOffsetAtEnd, getEndWidth, getFullId, getId, getLateralBoundaryPosition, getLateralBoundaryPosition, getLateralCenterPosition, getLateralCenterPosition, getLength, getLocation, getParentLink, getWidth, getWidth
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, removeAllListeners, removeAllListeners, removeListener
public static final EventType GTU_ADD_EVENT
public static final EventType GTU_REMOVE_EVENT
public static final EventType SENSOR_ADD_EVENT
public static final EventType SENSOR_REMOVE_EVENT
public static final EventType OBJECT_ADD_EVENT
public static final EventType OBJECT_REMOVE_EVENT
public static final Length MARGIN
public Lane(CrossSectionLink parentLink, String id, Length lateralOffsetAtStart, Length lateralOffsetAtEnd, Length beginWidth, Length endWidth, LaneType laneType, Map<GTUType,Speed> speedLimitMap, OvertakingConditions overtakingConditions) throws OTSGeometryException, NetworkException
parentLink
- CrossSectionLink; the link to which the new Lane will belong (must be constructed first)id
- String; the id of this lane within the link; should be unique within the link.lateralOffsetAtStart
- Length; the lateral offset of the design line of the new CrossSectionLink with respect to the
design line of the parent Link at the start of the parent LinklateralOffsetAtEnd
- Length; the lateral offset of the design line of the new CrossSectionLink with respect to the
design line of the parent Link at the end of the parent LinkbeginWidth
- Length; start width, positioned symmetrically around the design lineendWidth
- Length; end width, positioned symmetrically around the design linelaneType
- LaneType; the type of lane to deduce compatibility with GTU typesspeedLimitMap
- Map<GTUType, Speed>; speed limit on this lane, specified per GTU TypeovertakingConditions
- OvertakingConditions; the conditions for overtaking another GTU, viewed from this laneOTSGeometryException
- when creation of the center line or contour geometry failsNetworkException
- when id equal to null or not uniquepublic Lane(CrossSectionLink parentLink, String id, Length lateralOffsetAtStart, Length lateralOffsetAtEnd, Length beginWidth, Length endWidth, LaneType laneType, Speed speedLimit, OvertakingConditions overtakingConditions) throws OTSGeometryException, NetworkException
parentLink
- CrossSectionLink; the link to which the element will belong (must be constructed first)id
- String; the id of this lane within the link; should be unique within the link.lateralOffsetAtStart
- Length; the lateral offset of the design line of the new CrossSectionLink with respect to the
design line of the parent Link at the start of the parent LinklateralOffsetAtEnd
- Length; the lateral offset of the design line of the new CrossSectionLink with respect to the
design line of the parent Link at the end of the parent LinkbeginWidth
- Length; start width, positioned symmetrically around the design lineendWidth
- Length; end width, positioned symmetrically around the design linelaneType
- LaneType; the type of lane to deduce compatibility with GTU typesspeedLimit
- Speed; speed limit on this laneovertakingConditions
- OvertakingConditions; the conditions for overtaking another GTU, viewed from this laneOTSGeometryException
- when creation of the center line or contour geometry failsNetworkException
- when id equal to null or not uniquepublic Lane(CrossSectionLink parentLink, String id, Length lateralOffset, Length width, LaneType laneType, Map<GTUType,Speed> speedLimitMap, OvertakingConditions overtakingConditions) throws OTSGeometryException, NetworkException
parentLink
- CrossSectionLink; the link to which the element will belong (must be constructed first)id
- String; the id of this lane within the link; should be unique within the link.lateralOffset
- Length; the lateral offset of the design line of the new CrossSectionLink with respect to the design
line of the parent Linkwidth
- Length; width, positioned symmetrically around the design linelaneType
- LaneType; type of lane to deduce compatibility with GTU typesspeedLimitMap
- Map<GTUType, Speed>; the speed limit on this lane, specified per GTU TypeovertakingConditions
- OvertakingConditions; the conditions for overtaking another GTU, viewed from this laneOTSGeometryException
- when creation of the center line or contour geometry failsNetworkException
- when id equal to null or not uniquepublic Lane(CrossSectionLink parentLink, String id, Length lateralOffset, Length width, LaneType laneType, Speed speedLimit, OvertakingConditions overtakingConditions) throws OTSGeometryException, NetworkException
parentLink
- CrossSectionLink; the link to which the element belongs (must be constructed first)id
- String; the id of this lane within the link; should be unique within the linklateralOffset
- Length; the lateral offset of the design line of the new CrossSectionLink with respect to the design
line of the parent Linkwidth
- Length; width, positioned symmetrically around the design linelaneType
- LaneType; the type of lane to deduce compatibility with GTU typesspeedLimit
- Speed; the speed limit on this laneovertakingConditions
- OvertakingConditions; the conditions for overtaking another GTU, viewed from this laneOTSGeometryException
- when creation of the center line or contour geometry failsNetworkException
- when id equal to null or not uniquepublic Lane(CrossSectionLink parentLink, String id, List<CrossSectionSlice> crossSectionSlices, LaneType laneType, Map<GTUType,Speed> speedLimitMap, OvertakingConditions overtakingConditions) throws OTSGeometryException, NetworkException
parentLink
- CrossSectionLink; the link to which the element belongs (must be constructed first)id
- String; the id of this lane within the link; should be unique within the link.crossSectionSlices
- 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.laneType
- LaneType; the type of lane to deduce compatibility with GTU typesspeedLimitMap
- Map<GTUType, Speed>; the speed limit on this lane, specified per GTU TypeovertakingConditions
- OvertakingConditions; the conditions for overtaking another GTU, viewed from this laneOTSGeometryException
- when creation of the center line or contour geometry failsNetworkException
- when id equal to null or not uniquepublic Lane(CrossSectionLink parentLink, String id, List<CrossSectionSlice> crossSectionSlices, LaneType laneType, Speed speedLimit, OvertakingConditions overtakingConditions) throws OTSGeometryException, NetworkException
parentLink
- CrossSectionLink; the link to which the element belongs (must be constructed first)id
- String; the id of this lane within the link; should be unique within the link.crossSectionSlices
- 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.laneType
- LaneType; the type of lane to deduce compatibility with GTU typesspeedLimit
- Speed; the speed limit on this laneovertakingConditions
- OvertakingConditions; the conditions for overtaking another GTU, viewed from this laneOTSGeometryException
- when creation of the center line or contour geometry failsNetworkException
- when id equal to null or not uniqueprotected Lane(CrossSectionLink newParentLink, SimulatorInterface.TimeDoubleUnit newSimulator, Lane cse) throws NetworkException
newParentLink
- CrossSectionLink; the new link to which the clone belongsnewSimulator
- SimulatorInterface.TimeDoubleUnit; the new simulator for this networkcse
- Lane; the element to clone fromNetworkException
- 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.public final void addSensor(SingleSensor sensor) throws NetworkException
sensor
- SingleSensor; the sensor to addNetworkException
- when the position of the sensor is beyond (or before) the range of this Lanepublic final void removeSensor(SingleSensor sensor) throws NetworkException
sensor
- SingleSensor; the sensor to remove.NetworkException
- when the sensor was not found on this Lanepublic final List<SingleSensor> getSensors(Length minimumPosition, Length maximumPosition, GTUType gtuType, GTUDirectionality direction)
minimumPosition
- Length; the minimum distance on the Lane (inclusive)maximumPosition
- Length; the maximum distance on the Lane (inclusive)gtuType
- GTUType; the GTU type to provide the sensors fordirection
- GTUDirectionality; direction of movement of the GTUpublic final List<SingleSensor> getSensors(GTUType gtuType, GTUDirectionality direction)
gtuType
- GTUType; the GTU type to provide the sensors fordirection
- GTUDirectionality; direction of movement of the GTUpublic final List<SingleSensor> getSensors()
public final SortedMap<Double,List<SingleSensor>> getSensorMap(GTUType gtuType, GTUDirectionality direction)
gtuType
- GTUType; the GTU type to provide the sensors fordirection
- GTUDirectionality; direction of movement of the GTUpublic final void scheduleSensorTriggers(LaneBasedGTU gtu, double referenceStartSI, double referenceMoveSI) throws NetworkException, SimRuntimeException
gtu
- LaneBasedGTU; the lane based GTU for which to schedule triggering of the sensors.referenceStartSI
- double; the SI distance of the GTU reference point on the lane at the current timereferenceMoveSI
- double; the SI distance traveled in the next time step.NetworkException
- when GTU not on this lane.SimRuntimeException
- when method cannot be scheduled.public final void addLaneBasedObject(LaneBasedObject laneBasedObject) throws NetworkException
laneBasedObject
- LaneBasedObject; the laneBasedObject to addNetworkException
- when the position of the laneBasedObject is beyond (or before) the range of this Lanepublic final void removeLaneBasedObject(LaneBasedObject laneBasedObject) throws NetworkException
laneBasedObject
- LaneBasedObject; the laneBasedObject to remove.NetworkException
- when the laneBasedObject was not found on this Lanepublic final List<LaneBasedObject> getLaneBasedObjects(Length minimumPosition, Length maximumPosition)
minimumPosition
- Length; the minimum distance on the Lane (inclusive)maximumPosition
- Length; the maximum distance on the Lane (inclusive)public final List<LaneBasedObject> getLaneBasedObjects()
public final SortedMap<Double,List<LaneBasedObject>> getLaneBasedObjectMap()
public final Length position(double fraction)
fraction
- double; fraction relative to the lane length.public final double positionSI(double fraction)
fraction
- double; fraction relative to the lane length.public final double fraction(Length position)
position
- Length; relative length on the lane (may be less than zero or larger than the lane length).public final double fractionSI(double positionSI)
positionSI
- double; relative length on the lane in SI units (may be less than zero or larger than the lane length).public final int addGTU(LaneBasedGTU gtu, double fractionalPosition) throws GTUException
gtu
- LaneBasedGTU; the GTU to addfractionalPosition
- double; the fractional position that the newly added GTU will have on this LaneGTUException
- when the fractionalPosition is outside the range 0..1, or the GTU is already registered on this Lanepublic final int addGTU(LaneBasedGTU gtu, Length longitudinalPosition) throws GTUException
gtu
- LaneBasedGTU; the GTU to addlongitudinalPosition
- Length; the longitudinal position that the newly added GTU will have on this LaneGTUException
- when longitudinalPosition is negative or exceeds the length of this Lanepublic final void removeGTU(LaneBasedGTU gtu, boolean removeFromParentLink, Length position)
gtu
- LaneBasedGTU; the GTU to remove.removeFromParentLink
- boolean; when the GTU leaves the last lane of the parentLink of this Laneposition
- Length; last position of the GTUpublic final LaneBasedGTU getLastGtu(GTUDirectionality direction) throws GTUException
direction
- GTUDirectionality; whether we are looking in the the design line direction or against the center line
direction.GTUException
- when there is a problem with the position of the GTUs on the lane.public final LaneBasedGTU getFirstGtu(GTUDirectionality direction) throws GTUException
direction
- GTUDirectionality; whether we are looking in the the design line direction or against the center line
direction.GTUException
- when there is a problem with the position of the GTUs on the lane.public final LaneBasedGTU getGtuAhead(Length position, GTUDirectionality direction, RelativePosition.TYPE relativePosition, Time when) throws GTUException
position
- Length; the position before which the relative position of a GTU will be searched.direction
- GTUDirectionality; whether we are looking in the the center line direction or against the center line
direction.relativePosition
- RelativePosition.TYPE; the relative position we want to compare againstwhen
- Time; the time for which to evaluate the positions.GTUException
- when there is a problem with the position of the GTUs on the lane.public final List<LaneBasedObject> getObjectAhead(Length position, GTUDirectionality direction)
position
- Length; the position after which the relative position of an object will be searched.direction
- GTUDirectionality; whether we are looking in the the center line direction or against the center line
direction.public final List<LaneBasedObject> getObjectBehind(Length position, GTUDirectionality direction)
position
- Length; the position after which the relative position of an object will be searched.direction
- GTUDirectionality; whether we are looking in the the center line direction or against the center line
direction.public final LaneBasedGTU getGtuBehind(Length position, GTUDirectionality direction, RelativePosition.TYPE relativePosition, Time when) throws GTUException
position
- Length; the position before which the relative position of a GTU will be searched.direction
- GTUDirectionality; whether we are looking in the the center line direction or against the center line
direction.relativePosition
- RelativePosition.TYPE; the relative position of the GTU we are looking for.when
- Time; the time for which to evaluate the positions.GTUException
- when there is a problem with the position of the GTUs on the lane.public final Map<Lane,GTUDirectionality> nextLanes(GTUType gtuType)
gtuType
- the GTU type for which we return the next lanes, use null
to return all next lanes and their
design directionpublic final Map<Lane,GTUDirectionality> prevLanes(GTUType gtuType)
gtuType
- the GTU type for which we return the next lanes, use null
to return all prev lanes and their
design directionpublic final Map<Lane,GTUDirectionality> downstreamLanes(GTUDirectionality direction, GTUType gtuType)
direction
- GTUDirectionality; gtu directiongtuType
- GTUType; gtu typepublic final Map<Lane,GTUDirectionality> upstreamLanes(GTUDirectionality direction, GTUType gtuType)
direction
- GTUDirectionality; gtu directiongtuType
- GTUType; gtu typepublic final Set<Lane> accessibleAdjacentLanesPhysical(LateralDirectionality lateralDirection, GTUType gtuType, GTUDirectionality drivingDirection)
lateralDirection
- LateralDirectionality; LEFT or RIGHT.gtuType
- GTUType; the type of GTU for which to return the adjacent lanes.drivingDirection
- GTUDirectionality; the driving direction of the GTU on <code>this</code> Lanepublic final Set<Lane> accessibleAdjacentLanesLegal(LateralDirectionality lateralDirection, GTUType gtuType, GTUDirectionality drivingDirection)
lateralDirection
- LateralDirectionality; LEFT or RIGHT.gtuType
- GTUType; the type of GTU for which to return the adjacent lanes.drivingDirection
- GTUDirectionality; the driving direction of the GTU on <code>this</code> Lanepublic final Speed getSpeedLimit(GTUType gtuType) throws NetworkException
gtuType
- GTUType; the GTU type to provide the speed limit forNetworkException
- on network inconsistencypublic final Speed getLowestSpeedLimit() throws NetworkException
NetworkException
- on network inconsistencypublic final Speed getHighestSpeedLimit() throws NetworkException
NetworkException
- on network inconsistencypublic final void setSpeedLimit(GTUType gtuType, Speed speedLimit)
gtuType
- GTUType; the GTU type to provide the speed limit forspeedLimit
- Speed; the speed limit for this gtu typepublic final void removeSpeedLimit(GTUType gtuType)
gtuType
- GTUType; the GTU type to provide the speed limit forpublic final LaneType getLaneType()
public final ImmutableList<LaneBasedGTU> getGtuList()
public final List<LaneBasedGTU> getGtuList(Time time)
time
- Time; timepublic final int numberOfGtus()
public final int numberOfGtus(Time time)
time
- Time; timepublic final int indexOfGtu(LaneBasedGTU gtu)
gtu
- LaneBasedGTU; gtu to get the index ofpublic final int indexOfGtu(LaneBasedGTU gtu, Time time)
gtu
- LaneBasedGTU; gtu to get the index oftime
- Time; timepublic final LaneBasedGTU getGtu(int index)
index
- int; index of the GTUpublic final LaneBasedGTU getGtu(int index, Time time)
index
- int; index of the GTUtime
- Time; timeprotected double getZ()
getZ
in class CrossSectionElement
public final OvertakingConditions getOvertakingConditions()
public final String toString()
toString
in class CrossSectionElement
public int hashCode()
hashCode
in class CrossSectionElement
public boolean equals(Object obj)
equals
in class CrossSectionElement
public Lane clone(CrossSectionLink newParentLink, SimulatorInterface.TimeDoubleUnit newSimulator) throws NetworkException
clone
in class CrossSectionElement
newParentLink
- CrossSectionLink; the new link to which the clone belongsnewSimulator
- SimulatorInterface.TimeDoubleUnit; the new simulator for this networkNetworkException
- in case the cloning failsCopyright © 2014–2019 Delft University of Technology. All rights reserved.