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 TypeMethodDescriptiondouble
approximate
(int currentNode) double
getSlack()
reverse()
Makes a 'reverse' copy of itself to make it possible using the two objects independent e.g.void
setTo
(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:
approximate
in interfaceWeightApproximator
- Returns:
- minimal weight of the specified currentNode to the 'to' node
-
setTo
public void setTo(int to) - Specified by:
setTo
in interfaceWeightApproximator
-
reverse
Description copied from interface:WeightApproximator
Makes 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:
reverse
in interfaceWeightApproximator
-
getSlack
public double getSlack()- Specified by:
getSlack
in interfaceWeightApproximator
-