Package org.planit.route
Interface Route
-
- All Known Implementing Classes:
RouteImpl
public interface Route
Route interface representing a route through the network on edge segment level- Author:
- markr
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Boolean
addEdgeSegment(EdgeSegment edgeSegment)
add an edge segment to the path by appending itstatic Route
createRoute(IdGroupingToken groupId, Centroid destination, Pair<Double,EdgeSegment>[] vertexPathAndCost)
Create the route from an implicit origin to a specified destination, using the vertexPathAndCost array as input coming from a shortest path algorithm output This method makes use of the fact that the origin pair in the vertexPathAndCost array has a null EdgeSegment.long
getId()
Return the Id of this pathIterator<EdgeSegment>
getIterator()
Iterator over the available edge segmentsList<EdgeSegment>
getPath()
Return the route as a List of EdgeSegmentsString
toString(RouteIdType pathOutputType)
Outputs this path as a String, appropriate to a specified path output type
-
-
-
Method Detail
-
addEdgeSegment
Boolean addEdgeSegment(EdgeSegment edgeSegment)
add an edge segment to the path by appending it- Parameters:
edgeSegment
- the edge segment to add- Returns:
- true as per Collection.add
-
getIterator
Iterator<EdgeSegment> getIterator()
Iterator over the available edge segments- Returns:
- edgseSegmentIterator
-
toString
String toString(RouteIdType pathOutputType)
Outputs this path as a String, appropriate to a specified path output type- Parameters:
pathOutputType
- the specified path output type- Returns:
- String describing the path
-
getPath
List<EdgeSegment> getPath()
Return the route as a List of EdgeSegments- Returns:
- the path as a List of EdgeSegments
-
getId
long getId()
Return the Id of this path- Returns:
- the Id of this path
-
createRoute
static Route createRoute(IdGroupingToken groupId, Centroid destination, Pair<Double,EdgeSegment>[] vertexPathAndCost)
Create the route from an implicit origin to a specified destination, using the vertexPathAndCost array as input coming from a shortest path algorithm output This method makes use of the fact that the origin pair in the vertexPathAndCost array has a null EdgeSegment. It searches through vertexPathAndCost from the destination centroid until it finds a null EdgeSegment, which must represent the origin centroid. This is quicker than doing an instanceof test to determine whether the upstream vertex is a physical node.- Parameters:
groupId
- contiguous id generation within this group for instances of this classdestination
- the specified destination zonevertexPathAndCost
- the vertexPathAndCost array (previously calculated by the traffic assignment)- Returns:
- the route that is created
-
-