public class Lane extends CrossSectionElement implements Serializable
Copyright (c) 2013-2017 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 |
---|---|
(package private) static org.djunits.value.vdouble.scalar.Length |
ADJACENT_MARGIN
Lateral alignment margin for longitudinally connected Lanes.
|
static nl.tudelft.simulation.event.EventType |
GTU_ADD_EVENT
The timed event type for pub/sub indicating the addition of a GTU to the lane.
|
static nl.tudelft.simulation.event.EventType |
GTU_REMOVE_EVENT
The timed event type for pub/sub indicating the removal of a GTU from the lane.
|
static org.djunits.value.vdouble.scalar.Length |
MARGIN
Lateral alignment margin for longitudinally connected Lanes.
|
static nl.tudelft.simulation.event.EventType |
OBJECT_ADD_EVENT
The event type for pub/sub indicating the addition of a LaneBasedObject to the lane.
|
static nl.tudelft.simulation.event.EventType |
OBJECT_REMOVE_EVENT
The event type for pub/sub indicating the removal of a LaneBasedObject from the lane.
|
static nl.tudelft.simulation.event.EventType |
SENSOR_ADD_EVENT
The timed event type for pub/sub indicating the addition of a Sensor to the lane.
|
static nl.tudelft.simulation.event.EventType |
SENSOR_REMOVE_EVENT
The timed event type for pub/sub indicating the removal of a Sensor from the lane.
|
crossSectionSlices, length, parentLink
Modifier | Constructor and Description |
---|---|
protected |
Lane(CrossSectionLink newParentLink,
org.opentrafficsim.core.dsol.OTSSimulatorInterface newSimulator,
boolean animation,
Lane cse)
Clone a Lane for a new network.
|
|
Lane(CrossSectionLink parentLink,
String id,
org.djunits.value.vdouble.scalar.Length lateralOffset,
org.djunits.value.vdouble.scalar.Length width,
LaneType laneType,
org.opentrafficsim.core.network.LongitudinalDirectionality directionality,
org.djunits.value.vdouble.scalar.Speed speedLimit,
OvertakingConditions overtakingConditions)
Construct a new Lane.
|
|
Lane(CrossSectionLink parentLink,
String id,
org.djunits.value.vdouble.scalar.Length lateralOffset,
org.djunits.value.vdouble.scalar.Length width,
LaneType laneType,
Map<org.opentrafficsim.core.gtu.GTUType,org.opentrafficsim.core.network.LongitudinalDirectionality> directionalityMap,
Map<org.opentrafficsim.core.gtu.GTUType,org.djunits.value.vdouble.scalar.Speed> speedLimitMap,
OvertakingConditions overtakingConditions)
Construct a new Lane.
|
|
Lane(CrossSectionLink parentLink,
String id,
org.djunits.value.vdouble.scalar.Length lateralOffsetAtStart,
org.djunits.value.vdouble.scalar.Length lateralOffsetAtEnd,
org.djunits.value.vdouble.scalar.Length beginWidth,
org.djunits.value.vdouble.scalar.Length endWidth,
LaneType laneType,
org.opentrafficsim.core.network.LongitudinalDirectionality directionality,
org.djunits.value.vdouble.scalar.Speed speedLimit,
OvertakingConditions overtakingConditions)
Construct a new Lane.
|
|
Lane(CrossSectionLink parentLink,
String id,
org.djunits.value.vdouble.scalar.Length lateralOffsetAtStart,
org.djunits.value.vdouble.scalar.Length lateralOffsetAtEnd,
org.djunits.value.vdouble.scalar.Length beginWidth,
org.djunits.value.vdouble.scalar.Length endWidth,
LaneType laneType,
Map<org.opentrafficsim.core.gtu.GTUType,org.opentrafficsim.core.network.LongitudinalDirectionality> directionalityMap,
Map<org.opentrafficsim.core.gtu.GTUType,org.djunits.value.vdouble.scalar.Speed> speedLimitMap,
OvertakingConditions overtakingConditions)
Construct a new Lane.
|
|
Lane(CrossSectionLink parentLink,
String id,
List<CrossSectionSlice> crossSectionSlices,
LaneType laneType,
org.opentrafficsim.core.network.LongitudinalDirectionality directionality,
org.djunits.value.vdouble.scalar.Speed speedLimit,
OvertakingConditions overtakingConditions)
Construct a new Lane.
|
|
Lane(CrossSectionLink parentLink,
String id,
List<CrossSectionSlice> crossSectionSlices,
LaneType laneType,
Map<org.opentrafficsim.core.gtu.GTUType,org.opentrafficsim.core.network.LongitudinalDirectionality> directionalityMap,
Map<org.opentrafficsim.core.gtu.GTUType,org.djunits.value.vdouble.scalar.Speed> speedLimitMap,
OvertakingConditions overtakingConditions)
Construct a new Lane.
|
Modifier and Type | Method and Description |
---|---|
Set<Lane> |
accessibleAdjacentLanes(org.opentrafficsim.core.network.LateralDirectionality lateralDirection,
org.opentrafficsim.core.gtu.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.
|
void |
addDirectionality(org.opentrafficsim.core.gtu.GTUType gtuType,
org.opentrafficsim.core.network.LongitudinalDirectionality directionality)
This method sets the directionality of the lane for a GTU type.
|
int |
addGTU(LaneBasedGTU gtu,
double fractionalPosition)
Add a LaneBasedGTU to the list of this Lane.
|
int |
addGTU(LaneBasedGTU gtu,
org.djunits.value.vdouble.scalar.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,
org.opentrafficsim.core.dsol.OTSSimulatorInterface newSimulator,
boolean animation)
Clone the CrossSectionElement for e.g., copying a network.
|
Map<Lane,org.opentrafficsim.core.gtu.GTUDirectionality> |
downstreamLanes(org.opentrafficsim.core.gtu.GTUDirectionality direction,
org.opentrafficsim.core.gtu.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(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.
|
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.
|
org.opentrafficsim.core.network.LongitudinalDirectionality |
getDirectionality(org.opentrafficsim.core.gtu.GTUType gtuType)
The direction in which vehicles can drive, i.e., in direction of geometry, reverse, or both.
|
LaneBasedGTU |
getFirstGtu(org.opentrafficsim.core.gtu.GTUDirectionality direction)
Get the first GTU on the lane, relative to a driving direction on this lane.
|
LaneBasedGTU |
getGtuAhead(org.djunits.value.vdouble.scalar.Length position,
org.opentrafficsim.core.gtu.GTUDirectionality direction,
org.opentrafficsim.core.gtu.RelativePosition.TYPE relativePosition,
org.djunits.value.vdouble.scalar.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(org.djunits.value.vdouble.scalar.Length position,
org.opentrafficsim.core.gtu.GTUDirectionality direction,
org.opentrafficsim.core.gtu.RelativePosition.TYPE relativePosition,
org.djunits.value.vdouble.scalar.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.
|
nl.tudelft.simulation.immutablecollections.ImmutableList<LaneBasedGTU> |
getGtuList() |
org.djunits.value.vdouble.scalar.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(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.
|
LaneType |
getLaneType() |
LaneBasedGTU |
getLastGtu(org.opentrafficsim.core.gtu.GTUDirectionality direction)
Get the last GTU on the lane, relative to a driving direction on this lane.
|
List<LaneBasedObject> |
getObjectAhead(org.djunits.value.vdouble.scalar.Length position,
org.opentrafficsim.core.gtu.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(org.djunits.value.vdouble.scalar.Length position,
org.opentrafficsim.core.gtu.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(org.opentrafficsim.core.gtu.GTUType gtuType)
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(org.opentrafficsim.core.gtu.GTUType gtuType)
Retrieve the list of Sensors of this Lane that are triggered by the given GTUType.
|
List<SingleSensor> |
getSensors(org.djunits.value.vdouble.scalar.Length minimumPosition,
org.djunits.value.vdouble.scalar.Length maximumPosition,
org.opentrafficsim.core.gtu.GTUType gtuType)
Retrieve the list of Sensors of this Lane in the specified distance range for the given GTUType.
|
org.djunits.value.vdouble.scalar.Speed |
getSpeedLimit(org.opentrafficsim.core.gtu.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() |
Map<Lane,org.opentrafficsim.core.gtu.GTUDirectionality> |
nextLanes(org.opentrafficsim.core.gtu.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. |
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).
|
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,org.opentrafficsim.core.gtu.GTUDirectionality> |
prevLanes(org.opentrafficsim.core.gtu.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 |
removeDirectionality(org.opentrafficsim.core.gtu.GTUType gtuType)
This method removes an earlier provided directionality of the lane for a given GTU type, e.g.
|
void |
removeGTU(LaneBasedGTU gtu,
boolean removeFromParentLink,
org.djunits.value.vdouble.scalar.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(org.opentrafficsim.core.gtu.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(org.opentrafficsim.core.gtu.GTUType gtuType,
org.djunits.value.vdouble.scalar.Speed speedLimit)
Set the speed limit of this lane, which can differ per GTU type.
|
String |
toString() |
Map<Lane,org.opentrafficsim.core.gtu.GTUDirectionality> |
upstreamLanes(org.opentrafficsim.core.gtu.GTUDirectionality direction,
org.opentrafficsim.core.gtu.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 nl.tudelft.simulation.event.EventType GTU_ADD_EVENT
public static final nl.tudelft.simulation.event.EventType GTU_REMOVE_EVENT
public static final nl.tudelft.simulation.event.EventType SENSOR_ADD_EVENT
public static final nl.tudelft.simulation.event.EventType SENSOR_REMOVE_EVENT
public static final nl.tudelft.simulation.event.EventType OBJECT_ADD_EVENT
public static final nl.tudelft.simulation.event.EventType OBJECT_REMOVE_EVENT
static final org.djunits.value.vdouble.scalar.Length ADJACENT_MARGIN
public static final org.djunits.value.vdouble.scalar.Length MARGIN
public Lane(CrossSectionLink parentLink, String id, org.djunits.value.vdouble.scalar.Length lateralOffsetAtStart, org.djunits.value.vdouble.scalar.Length lateralOffsetAtEnd, org.djunits.value.vdouble.scalar.Length beginWidth, org.djunits.value.vdouble.scalar.Length endWidth, LaneType laneType, Map<org.opentrafficsim.core.gtu.GTUType,org.opentrafficsim.core.network.LongitudinalDirectionality> directionalityMap, Map<org.opentrafficsim.core.gtu.GTUType,org.djunits.value.vdouble.scalar.Speed> speedLimitMap, OvertakingConditions overtakingConditions) throws org.opentrafficsim.core.geometry.OTSGeometryException, org.opentrafficsim.core.network.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 typesdirectionalityMap
- Map<GTUType, LongitudinalDirectionality>; in direction of geometry, reverse, or both,
specified per GTU TypespeedLimitMap
- Map<GTUType, Speed>; speed limit on this lane, specified per GTU TypeovertakingConditions
- OvertakingConditions; the conditions for overtaking another GTU, viewed from this laneorg.opentrafficsim.core.geometry.OTSGeometryException
- when creation of the center line or contour geometry failsorg.opentrafficsim.core.network.NetworkException
- when id equal to null or not uniquepublic Lane(CrossSectionLink parentLink, String id, org.djunits.value.vdouble.scalar.Length lateralOffsetAtStart, org.djunits.value.vdouble.scalar.Length lateralOffsetAtEnd, org.djunits.value.vdouble.scalar.Length beginWidth, org.djunits.value.vdouble.scalar.Length endWidth, LaneType laneType, org.opentrafficsim.core.network.LongitudinalDirectionality directionality, org.djunits.value.vdouble.scalar.Speed speedLimit, OvertakingConditions overtakingConditions) throws org.opentrafficsim.core.geometry.OTSGeometryException, org.opentrafficsim.core.network.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 typesdirectionality
- LongitudinalDirectionality; in direction of geometry, reverse, or bothspeedLimit
- Speed; speed limit on this laneovertakingConditions
- OvertakingConditions; the conditions for overtaking another GTU, viewed from this laneorg.opentrafficsim.core.geometry.OTSGeometryException
- when creation of the center line or contour geometry failsorg.opentrafficsim.core.network.NetworkException
- when id equal to null or not uniquepublic Lane(CrossSectionLink parentLink, String id, org.djunits.value.vdouble.scalar.Length lateralOffset, org.djunits.value.vdouble.scalar.Length width, LaneType laneType, Map<org.opentrafficsim.core.gtu.GTUType,org.opentrafficsim.core.network.LongitudinalDirectionality> directionalityMap, Map<org.opentrafficsim.core.gtu.GTUType,org.djunits.value.vdouble.scalar.Speed> speedLimitMap, OvertakingConditions overtakingConditions) throws org.opentrafficsim.core.geometry.OTSGeometryException, org.opentrafficsim.core.network.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
- type of lane to deduce compatibility with GTU typesdirectionalityMap
- Map<GTUType, LongitudinalDirectionality>; in direction of geometry, reverse, or both,
specified per GTU TypespeedLimitMap
- Map<GTUType, Speed>; the speed limit on this lane, specified per GTU TypeovertakingConditions
- OvertakingConditions; the conditions for overtaking another GTU, viewed from this laneorg.opentrafficsim.core.geometry.OTSGeometryException
- when creation of the center line or contour geometry failsorg.opentrafficsim.core.network.NetworkException
- when id equal to null or not uniquepublic Lane(CrossSectionLink parentLink, String id, org.djunits.value.vdouble.scalar.Length lateralOffset, org.djunits.value.vdouble.scalar.Length width, LaneType laneType, org.opentrafficsim.core.network.LongitudinalDirectionality directionality, org.djunits.value.vdouble.scalar.Speed speedLimit, OvertakingConditions overtakingConditions) throws org.opentrafficsim.core.geometry.OTSGeometryException, org.opentrafficsim.core.network.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 typesdirectionality
- in direction of geometry, reverse, or bothspeedLimit
- Speed; the speed limit on this laneovertakingConditions
- OvertakingConditions; the conditions for overtaking another GTU, viewed from this laneorg.opentrafficsim.core.geometry.OTSGeometryException
- when creation of the center line or contour geometry failsorg.opentrafficsim.core.network.NetworkException
- when id equal to null or not uniquepublic Lane(CrossSectionLink parentLink, String id, List<CrossSectionSlice> crossSectionSlices, LaneType laneType, Map<org.opentrafficsim.core.gtu.GTUType,org.opentrafficsim.core.network.LongitudinalDirectionality> directionalityMap, Map<org.opentrafficsim.core.gtu.GTUType,org.djunits.value.vdouble.scalar.Speed> speedLimitMap, OvertakingConditions overtakingConditions) throws org.opentrafficsim.core.geometry.OTSGeometryException, org.opentrafficsim.core.network.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 typesdirectionalityMap
- Map<GTUType, LongitudinalDirectionality>; in direction of geometry, reverse, or both,
specified per GTU TypespeedLimitMap
- Map<GTUType, Speed>; the speed limit on this lane, specified per GTU TypeovertakingConditions
- OvertakingConditions; the conditions for overtaking another GTU, viewed from this laneorg.opentrafficsim.core.geometry.OTSGeometryException
- when creation of the center line or contour geometry failsorg.opentrafficsim.core.network.NetworkException
- when id equal to null or not uniquepublic Lane(CrossSectionLink parentLink, String id, List<CrossSectionSlice> crossSectionSlices, LaneType laneType, org.opentrafficsim.core.network.LongitudinalDirectionality directionality, org.djunits.value.vdouble.scalar.Speed speedLimit, OvertakingConditions overtakingConditions) throws org.opentrafficsim.core.geometry.OTSGeometryException, org.opentrafficsim.core.network.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 typesdirectionality
- LongitudinalDirectionality; in direction of geometry, reverse, or bothspeedLimit
- Speed; the speed limit on this laneovertakingConditions
- OvertakingCondition; the conditions for overtaking another GTU, viewed from this laneorg.opentrafficsim.core.geometry.OTSGeometryException
- when creation of the center line or contour geometry failsorg.opentrafficsim.core.network.NetworkException
- when id equal to null or not uniqueprotected Lane(CrossSectionLink newParentLink, org.opentrafficsim.core.dsol.OTSSimulatorInterface newSimulator, boolean animation, Lane cse) throws org.opentrafficsim.core.network.NetworkException
newParentLink
- the new link to which the clone belongsnewSimulator
- the new simulator for this networkanimation
- whether to (re)create animation or notcse
- the element to clone fromorg.opentrafficsim.core.network.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.public final void addSensor(SingleSensor sensor) throws org.opentrafficsim.core.network.NetworkException
sensor
- Sensor; the sensor to addorg.opentrafficsim.core.network.NetworkException
- when the position of the sensor is beyond (or before) the range of this Lanepublic final void removeSensor(SingleSensor sensor) throws org.opentrafficsim.core.network.NetworkException
sensor
- Sensoe; the sensor to remove.org.opentrafficsim.core.network.NetworkException
- when the sensor was not found on this Lanepublic final List<SingleSensor> getSensors(org.djunits.value.vdouble.scalar.Length minimumPosition, org.djunits.value.vdouble.scalar.Length maximumPosition, org.opentrafficsim.core.gtu.GTUType gtuType)
minimumPosition
- Length; the minimum distance on the Lane (inclusive)maximumPosition
- Length; the maximum distance on the Lane (inclusive)gtuType
- the GTU type to provide the sensors forpublic final List<SingleSensor> getSensors(org.opentrafficsim.core.gtu.GTUType gtuType)
gtuType
- GTUType; the GTU type to provide the sensors forpublic final List<SingleSensor> getSensors()
public final SortedMap<Double,List<SingleSensor>> getSensorMap(org.opentrafficsim.core.gtu.GTUType gtuType)
gtuType
- GTUType; the GTU type to provide the sensors forpublic final void scheduleSensorTriggers(LaneBasedGTU gtu, double referenceStartSI, double referenceMoveSI) throws org.opentrafficsim.core.network.NetworkException, nl.tudelft.simulation.dsol.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.org.opentrafficsim.core.network.NetworkException
- when GTU not on this lane.nl.tudelft.simulation.dsol.SimRuntimeException
- when method cannot be scheduled.public final void addLaneBasedObject(LaneBasedObject laneBasedObject) throws org.opentrafficsim.core.network.NetworkException
laneBasedObject
- LaneBasedObject; the laneBasedObject to addorg.opentrafficsim.core.network.NetworkException
- when the position of the laneBasedObject is beyond (or before) the range of this Lanepublic final void removeLaneBasedObject(LaneBasedObject laneBasedObject) throws org.opentrafficsim.core.network.NetworkException
laneBasedObject
- LaneBasedObject; the laneBasedObject to remove.org.opentrafficsim.core.network.NetworkException
- when the laneBasedObject was not found on this Lanepublic final List<LaneBasedObject> getLaneBasedObjects(org.djunits.value.vdouble.scalar.Length minimumPosition, org.djunits.value.vdouble.scalar.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 org.djunits.value.vdouble.scalar.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(org.djunits.value.vdouble.scalar.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 org.opentrafficsim.core.gtu.GTUException
gtu
- LaneBasedGTU; the GTU to addfractionalPosition
- double; the fractional position that the newly added GTU will have on this Laneorg.opentrafficsim.core.gtu.GTUException
- when the fractionalPosition is outside the range 0..1, or the GTU is already registered on this Lanepublic final int addGTU(LaneBasedGTU gtu, org.djunits.value.vdouble.scalar.Length longitudinalPosition) throws org.opentrafficsim.core.gtu.GTUException
gtu
- LaneBasedGTU; the GTU to addlongitudinalPosition
- Length; the longitudinal position that the newly added GTU will have on this Laneorg.opentrafficsim.core.gtu.GTUException
- when longitudinalPosition is negative or exceeds the length of this Lanepublic final void removeGTU(LaneBasedGTU gtu, boolean removeFromParentLink, org.djunits.value.vdouble.scalar.Length position)
gtu
- the GTU to remove.removeFromParentLink
- when the GTU leaves the last lane of the parentLink of this Laneposition
- Length; last position of the GTUpublic final LaneBasedGTU getLastGtu(org.opentrafficsim.core.gtu.GTUDirectionality direction) throws org.opentrafficsim.core.gtu.GTUException
direction
- GTUDirectionality; whether we are looking in the the design line direction or against the center line
direction.org.opentrafficsim.core.gtu.GTUException
- when there is a problem with the position of the GTUs on the lane.public final LaneBasedGTU getFirstGtu(org.opentrafficsim.core.gtu.GTUDirectionality direction) throws org.opentrafficsim.core.gtu.GTUException
direction
- GTUDirectionality; whether we are looking in the the design line direction or against the center line
direction.org.opentrafficsim.core.gtu.GTUException
- when there is a problem with the position of the GTUs on the lane.public final LaneBasedGTU getGtuAhead(org.djunits.value.vdouble.scalar.Length position, org.opentrafficsim.core.gtu.GTUDirectionality direction, org.opentrafficsim.core.gtu.RelativePosition.TYPE relativePosition, org.djunits.value.vdouble.scalar.Time when) throws org.opentrafficsim.core.gtu.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.org.opentrafficsim.core.gtu.GTUException
- when there is a problem with the position of the GTUs on the lane.public final List<LaneBasedObject> getObjectAhead(org.djunits.value.vdouble.scalar.Length position, org.opentrafficsim.core.gtu.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(org.djunits.value.vdouble.scalar.Length position, org.opentrafficsim.core.gtu.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(org.djunits.value.vdouble.scalar.Length position, org.opentrafficsim.core.gtu.GTUDirectionality direction, org.opentrafficsim.core.gtu.RelativePosition.TYPE relativePosition, org.djunits.value.vdouble.scalar.Time when) throws org.opentrafficsim.core.gtu.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.org.opentrafficsim.core.gtu.GTUException
- when there is a problem with the position of the GTUs on the lane.public final Map<Lane,org.opentrafficsim.core.gtu.GTUDirectionality> nextLanes(org.opentrafficsim.core.gtu.GTUType gtuType)
gtuType
- the GTU type for which we return the next lanes.public final Map<Lane,org.opentrafficsim.core.gtu.GTUDirectionality> prevLanes(org.opentrafficsim.core.gtu.GTUType gtuType)
gtuType
- the GTU type for which we return the next lanes.public final Map<Lane,org.opentrafficsim.core.gtu.GTUDirectionality> downstreamLanes(org.opentrafficsim.core.gtu.GTUDirectionality direction, org.opentrafficsim.core.gtu.GTUType gtuType)
direction
- GTUDirectionality; gtu directiongtuType
- GTUType; gtu typepublic final Map<Lane,org.opentrafficsim.core.gtu.GTUDirectionality> upstreamLanes(org.opentrafficsim.core.gtu.GTUDirectionality direction, org.opentrafficsim.core.gtu.GTUType gtuType)
direction
- GTUDirectionality; gtu directiongtuType
- GTUType; gtu typepublic final Set<Lane> accessibleAdjacentLanes(org.opentrafficsim.core.network.LateralDirectionality lateralDirection, org.opentrafficsim.core.gtu.GTUType gtuType)
lateralDirection
- LEFT or RIGHT.gtuType
- the type of GTU for which to return the adjacent lanes.public final org.djunits.value.vdouble.scalar.Speed getSpeedLimit(org.opentrafficsim.core.gtu.GTUType gtuType) throws org.opentrafficsim.core.network.NetworkException
gtuType
- the GTU type to provide the speed limit fororg.opentrafficsim.core.network.NetworkException
- on network inconsistencypublic final org.djunits.value.vdouble.scalar.Speed getHighestSpeedLimit() throws org.opentrafficsim.core.network.NetworkException
org.opentrafficsim.core.network.NetworkException
- on network inconsistencypublic final void setSpeedLimit(org.opentrafficsim.core.gtu.GTUType gtuType, org.djunits.value.vdouble.scalar.Speed speedLimit)
gtuType
- the GTU type to provide the speed limit forspeedLimit
- the speed limit for this gtu typepublic final void removeSpeedLimit(org.opentrafficsim.core.gtu.GTUType gtuType)
gtuType
- the GTU type to provide the speed limit forpublic final LaneType getLaneType()
public final org.opentrafficsim.core.network.LongitudinalDirectionality getDirectionality(org.opentrafficsim.core.gtu.GTUType gtuType)
gtuType
- the GTU type to provide the directionality forpublic void addDirectionality(org.opentrafficsim.core.gtu.GTUType gtuType, org.opentrafficsim.core.network.LongitudinalDirectionality directionality) throws org.opentrafficsim.core.network.NetworkException
gtuType
- the GTU type to set the directionality for.directionality
- the longitudinal directionality of the link (FORWARD, BACKWARD, BOTH or NONE) for the given GTU
type.org.opentrafficsim.core.network.NetworkException
- when the lane directionality for the given GTUType is inconsistent with the Link directionality
to which the lane belongs.public void removeDirectionality(org.opentrafficsim.core.gtu.GTUType gtuType)
gtuType
- the GTU type to remove the directionality for on this lane.public final nl.tudelft.simulation.immutablecollections.ImmutableList<LaneBasedGTU> getGtuList()
protected 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, org.opentrafficsim.core.dsol.OTSSimulatorInterface newSimulator, boolean animation) throws org.opentrafficsim.core.network.NetworkException
clone
in class CrossSectionElement
newParentLink
- the new link to which the clone belongsnewSimulator
- the new simulator for this networkanimation
- whether to (re)create animation or notorg.opentrafficsim.core.network.NetworkException
- in case the cloning failsCopyright © 2014–2017 Delft University of Technology. All rights reserved.