Class MinMaxPathResultImpl
- java.lang.Object
-
- org.goplanit.algorithms.shortestpath.MinMaxPathResultImpl
-
- All Implemented Interfaces:
MinMaxPathResult
,ShortestPathResult
public class MinMaxPathResultImpl extends Object implements MinMaxPathResult
Implementation of the MinMaxPathResult interface- Author:
- markr
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
MinMaxPathResultImpl(double[] minVertexCost, EdgeSegment[] minCostBackwardEdgeSegments, double[] maxVertexCost, EdgeSegment[] maxCostBackwardEdgeSegments)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DirectedPath
createPath(DirectedPathFactory pathFactory, Vertex origin, Vertex destination)
Create the path from the provided origin to a specified destination vertex, using the results available.double
getCostToReach(Vertex vertex)
Collect the cost to reach the given vertexEdgeSegment
getIncomingEdgeSegmentForVertex(Vertex vertex)
Find the incoming edge segment for a given vertexvoid
setMinPathState(boolean flag)
Switch state to minimum path results-
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.shortestpath.ShortestPathResult
forEachBackwardEdgeSegment
-
-
-
-
Constructor Detail
-
MinMaxPathResultImpl
protected MinMaxPathResultImpl(double[] minVertexCost, EdgeSegment[] minCostBackwardEdgeSegments, double[] maxVertexCost, EdgeSegment[] maxCostBackwardEdgeSegments)
Constructor- Parameters:
minVertexCost
- foundminCostBackwardEdgeSegments
- foundmaxVertexCost
- foundmaxCostBackwardEdgeSegments
- found
-
-
Method Detail
-
createPath
public DirectedPath createPath(DirectedPathFactory pathFactory, Vertex origin, Vertex destination)
Create the path from the provided origin to a specified destination vertex, using the results available. The path builder is used to create the instance of the path.- Specified by:
createPath
in interfaceShortestPathResult
- Parameters:
pathFactory
- to use for creating path instancesorigin
- the specified origin vertexdestination
- the specified destination vertex- Returns:
- the path that is created, when no path could be extracted null is returned
-
getIncomingEdgeSegmentForVertex
public EdgeSegment getIncomingEdgeSegmentForVertex(Vertex vertex)
Find the incoming edge segment for a given vertex- Specified by:
getIncomingEdgeSegmentForVertex
in interfaceShortestPathResult
- Parameters:
vertex
- to get incoming segment for- Returns:
- incoming edge segment
-
getCostToReach
public double getCostToReach(Vertex vertex)
Collect the cost to reach the given vertex- Specified by:
getCostToReach
in interfaceShortestPathResult
- Parameters:
vertex
- to collect cost for- Returns:
- cost found
-
setMinPathState
public void setMinPathState(boolean flag)
Switch state to minimum path results- Specified by:
setMinPathState
in interfaceMinMaxPathResult
- Parameters:
flag
- when true switch to minimum paths, otherwise switch to maximum paths. Default is minimum paths
-
-