Package com.graphhopper.routing.lm
Class PerfectApproximator
java.lang.Object
com.graphhopper.routing.lm.PerfectApproximator
- All Implemented Interfaces:
WeightApproximator
Just a sanity-check implementation for WeightApproximator, which 'approximates' perfectly.
-
Constructor Summary
ConstructorsConstructorDescriptionPerfectApproximator(Graph graph, Weighting weighting, TraversalMode traversalMode, boolean reverse) -
Method Summary
Modifier and TypeMethodDescriptiondoubleapproximate(int currentNode) doublegetSlack()reverse()Makes a 'reverse' copy of itself to make it possible using the two objects independent e.g.voidsetTo(int to)
-
Constructor Details
-
PerfectApproximator
public PerfectApproximator(Graph graph, Weighting weighting, TraversalMode traversalMode, boolean reverse)
-
-
Method Details
-
approximate
public double approximate(int currentNode) - Specified by:
approximatein interfaceWeightApproximator- Returns:
- minimal weight of the specified currentNode to the 'to' node
-
setTo
public void setTo(int to) - Specified by:
setToin interfaceWeightApproximator
-
reverse
Description copied from interface:WeightApproximatorMakes a 'reverse' copy of itself to make it possible using the two objects independent e.g. on different threads. Do not copy state depending on the current approximate calls. 'reverse' means the WeightApproximator should handle approximate calls towards the 'from' instead towards the 'to'.- Specified by:
reversein interfaceWeightApproximator
-
getSlack
public double getSlack()- Specified by:
getSlackin interfaceWeightApproximator
-