Package org.goplanit.algorithms.shortest
Class ShortestBushResultGeneralised
- java.lang.Object
-
- org.goplanit.algorithms.shortest.ShortestResultGeneralised
-
- org.goplanit.algorithms.shortest.ShortestBushResultGeneralised
-
- All Implemented Interfaces:
ShortestBushResult,ShortestResult
public class ShortestBushResultGeneralised extends ShortestResultGeneralised implements ShortestBushResult
Class that stores the result of a shortest bush execution allowing one to extract bushes or cost information for a given origin-to-vertex Note that we construct the bush in reverse order from destination to the origin via all viable paths to construct the bush- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected Object[]nextEdgeSegmentsthe next edge segment(s) to reach the vertex with the given measured cost.protected intnumberOfEdgeSegmentsnumber of edge segments in the parent network-
Fields inherited from class org.goplanit.algorithms.shortest.ShortestResultGeneralised
getVertexAtExtreme, searchType, vertexMeasuredCost
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedShortestBushResultGeneralised(double[] vertexMeasuredCost, Object[] nextEdgeSegmentsByVertex, int numberOfEdgeSegments, ShortestSearchType searchType)Constructor only to be used by shortest path algorithms
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ACyclicSubGraphcreateDirectedAcyclicSubGraph(IdGroupingToken idToken, DirectedVertex origin, DirectedVertex destination)Create a bush in the form of a directed acyclic subgraph of its parent network (layer) for a given origin-destination vertex.doublegetCostOf(Vertex vertex)Collect the cost to reach the given vertex from the reference starting pointList<EdgeSegment>getNextEdgeSegmentsForVertex(Vertex vertex)Find the next edge segment for a given vertex, depending on the underlying search this can be either in upstream or downstream direction-
Methods inherited from class org.goplanit.algorithms.shortest.ShortestResultGeneralised
getNextVertexForEdgeSegment, getSearchType, getStartEndVertexForResultTraversal
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.algorithms.shortest.ShortestResult
getNextVertexForEdgeSegment, getSearchType, isInverted
-
-
-
-
Field Detail
-
nextEdgeSegments
protected final Object[] nextEdgeSegments
the next edge segment(s) to reach the vertex with the given measured cost. If only a single edge segment is present, that is what is stored, otherwise it is a list of edge segments
-
numberOfEdgeSegments
protected final int numberOfEdgeSegments
number of edge segments in the parent network
-
-
Constructor Detail
-
ShortestBushResultGeneralised
protected ShortestBushResultGeneralised(double[] vertexMeasuredCost, Object[] nextEdgeSegmentsByVertex, int numberOfEdgeSegments, ShortestSearchType searchType)Constructor only to be used by shortest path algorithms- Parameters:
vertexMeasuredCost- measured costs to get to the vertex (by id)nextEdgeSegmentsByVertex- the found next edge segment for each vertex (by id)numberOfEdgeSegments- on the parent networksearchType- used (one-to-all, all-to-one, etc)
-
-
Method Detail
-
createDirectedAcyclicSubGraph
public ACyclicSubGraph createDirectedAcyclicSubGraph(IdGroupingToken idToken, DirectedVertex origin, DirectedVertex destination)
Create a bush in the form of a directed acyclic subgraph of its parent network (layer) for a given origin-destination vertex. The direction of the result is inherited from the search itself, so if the search was inverted, the dag has an inverted root etc.- Specified by:
createDirectedAcyclicSubGraphin interfaceShortestBushResult- Parameters:
idToken- to use for the Acyclic subgraph's id generationorigin- to usedestination- to use- Returns:
- created acyclic graph
-
getNextEdgeSegmentsForVertex
public List<EdgeSegment> getNextEdgeSegmentsForVertex(Vertex vertex)
Find the next edge segment for a given vertex, depending on the underlying search this can be either in upstream or downstream direction- Specified by:
getNextEdgeSegmentsForVertexin interfaceShortestBushResult- Parameters:
vertex- to get next segment for- Returns:
- next edge segment
-
getCostOf
public double getCostOf(Vertex vertex)
Collect the cost to reach the given vertex from the reference starting point- Specified by:
getCostOfin interfaceShortestResult- Parameters:
vertex- to collect cost for- Returns:
- cost found
-
-