Package org.goplanit.algorithms.shortest
Class ShortestResultGeneralised
- java.lang.Object
-
- org.goplanit.algorithms.shortest.ShortestResultGeneralised
-
- All Implemented Interfaces:
ShortestResult
- Direct Known Subclasses:
ShortestBushResultGeneralised
,ShortestPathResultGeneralised
public abstract class ShortestResultGeneralised extends Object implements ShortestResult
Base class for shortestXResult classes- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected Function<EdgeSegment,DirectedVertex>
getVertexAtExtreme
depending on configuration this function collects vertex at desired edge segment extremityprotected ShortestSearchType
searchType
reflects the active typeprotected double[]
vertexMeasuredCost
the costs found by a shortest path run
-
Constructor Summary
Constructors Modifier Constructor Description protected
ShortestResultGeneralised(double[] vertexMeasuredCost, ShortestSearchType searchType)
Constructor only to be used by shortest X algorithms
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DirectedVertex
getNextVertexForEdgeSegment(EdgeSegment edgeSegment)
Find the next vertex on the given edge segment extremity based on the underlying search this can be either in upstream or downstream directionShortestSearchType
getSearchType()
Provide the search type that was used to obtain this resultprotected Pair<DirectedVertex,DirectedVertex>
getStartEndVertexForResultTraversal(DirectedVertex origin, DirectedVertex destination)
Determine the start and end vertex to use for constructing the path depending on the search type used in the preceding shortest path search-
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
getCostOf, isInverted
-
-
-
-
Field Detail
-
vertexMeasuredCost
protected final double[] vertexMeasuredCost
the costs found by a shortest path run
-
searchType
protected final ShortestSearchType searchType
reflects the active type
-
getVertexAtExtreme
protected Function<EdgeSegment,DirectedVertex> getVertexAtExtreme
depending on configuration this function collects vertex at desired edge segment extremity
-
-
Constructor Detail
-
ShortestResultGeneralised
protected ShortestResultGeneralised(double[] vertexMeasuredCost, ShortestSearchType searchType)
Constructor only to be used by shortest X algorithms- Parameters:
vertexMeasuredCost
- measured costs to get to the vertex (by id)searchType
- used (one-to-all, all-to-one, etc)
-
-
Method Detail
-
getStartEndVertexForResultTraversal
protected Pair<DirectedVertex,DirectedVertex> getStartEndVertexForResultTraversal(DirectedVertex origin, DirectedVertex destination)
Determine the start and end vertex to use for constructing the path depending on the search type used in the preceding shortest path search- Parameters:
origin
- of to be constructed pathdestination
- of to be constructed path- Returns:
- order in which origin and destination are to be encountered when traversing search results
-
getNextVertexForEdgeSegment
public DirectedVertex getNextVertexForEdgeSegment(EdgeSegment edgeSegment)
Find the next vertex on the given edge segment extremity based on the underlying search this can be either in upstream or downstream direction- Specified by:
getNextVertexForEdgeSegment
in interfaceShortestResult
- Parameters:
edgeSegment
- to get next vertex for- Returns:
- next vertex
-
getSearchType
public ShortestSearchType getSearchType()
Provide the search type that was used to obtain this result- Specified by:
getSearchType
in interfaceShortestResult
- Returns:
- shortest path search type used to obtain result
-
-