public class Route extends Object implements Serializable
NetworkException.
Copyright (c) 2013-2014 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights
reserved.
BSD-style license. See OpenTrafficSim License.
| Modifier and Type | Field and Description |
|---|---|
static DoubleScalar.Rel<LengthUnit> |
GETOFFTHISLANENOW
Return value of suitability when a lane change is required right now.
|
static DoubleScalar.Rel<LengthUnit> |
NOLANECHANGENEEDED
Return value of suitability when no lane change is required withing the time horizon.
|
| Constructor and Description |
|---|
Route()
Create an empty route.
|
Route(List<Node<?,?>> nodes)
Create a route based on an initial list of nodes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNode(int i,
Node<?,?> node)
Add a node at a specific location.
|
boolean |
addNode(Node<?,?> node)
Add a node to the end of the node list.
|
boolean |
containsLink(CrossSectionLink<?,?> link)
Determine if this Route contains the specified Link.
|
Node<?,?> |
destinationNode() |
Node<?,?> |
getNode(int i)
Return a node at a specific location.
|
int |
indexOf(Node<?,?> node)
Return the index of a Node in this Route, or -1 if this Route does not contain the specified Node.
|
Node<?,?> |
lastVisitedNode() |
Node<?,?> |
nextNodeToVisit()
This method does not advance the route pointer.
|
Node<?,?> |
originNode() |
Node<?,?> |
removeNode(int i)
Remove a node from a specific location.
|
int |
size() |
DoubleScalar.Rel<LengthUnit> |
suitability(Lane lane,
DoubleScalar.Rel<LengthUnit> longitudinalPosition,
GTUType<?> gtuType,
DoubleScalar.Rel<TimeUnit> timeHorizon)
Determine the suitability of being at a particular longitudinal position in a particular Lane for following this
Route.
|
String |
toString() |
Node<?,?> |
visitNextNode()
This method does advance the route pointer (if possible).
|
public static final DoubleScalar.Rel<LengthUnit> NOLANECHANGENEEDED
public static final DoubleScalar.Rel<LengthUnit> GETOFFTHISLANENOW
public final boolean addNode(Node<?,?> node) throws NetworkException
node - the node to add.NetworkException - when node could not be added.public final void addNode(int i,
Node<?,?> node)
throws NetworkException
i - the location to put the node (0-based).node - the node to add.NetworkException - when i<0 or i>=nodes.size(). Also thrown when another error occurs.public final Node<?,?> removeNode(int i) throws NetworkException
i - the location to remove the node from (0-based).NetworkException - when i is equal to the last visited node because the next link on the route cannot be
computed anymore. Also thrown when another error occurs.public final Node<?,?> getNode(int i) throws NetworkException
i - the location to get the node from (0-based).NetworkException - when i<0 or i>=nodes.size().public final Node<?,?> originNode() throws NetworkException
NetworkException - when the list has no nodes.public final int size()
public final Node<?,?> destinationNode() throws NetworkException
NetworkException - when the list has no nodes.public final Node<?,?> lastVisitedNode() throws NetworkException
NetworkException - when the index is out of bounds (should never happen).public final Node<?,?> nextNodeToVisit() throws NetworkException
NetworkException - when the index is out of bounds (should never happen).public final Node<?,?> visitNextNode() throws NetworkException
NetworkException - when the index is out of bounds (should never happen).public final boolean containsLink(CrossSectionLink<?,?> link)
link - the link to check in the route.public final int indexOf(Node<?,?> node)
node - Node<?, ?>; the Node to findpublic final DoubleScalar.Rel<LengthUnit> suitability(Lane lane, DoubleScalar.Rel<LengthUnit> longitudinalPosition, GTUType<?> gtuType, DoubleScalar.Rel<TimeUnit> timeHorizon) throws NetworkException
lane - Lane; the lane to considerlongitudinalPosition - DoubleScalar.Rel<LengthUnit>; the longitudinal position in the lanegtuType - GTUType<?>; the type of the GTU (used to check lane compatibility of lanes)timeHorizon - DoubleScalar.Rel<TimeUnit>; the maximum time that a driver may want to look aheadNetworkException - on network inconsistency, or when the continuation Link at a branch cannot be determinedCopyright © 2014–2015 Delft University of Technology. All rights reserved.