Package com.graphhopper.routing.lm
Class LMApproximator
java.lang.Object
com.graphhopper.routing.lm.LMApproximator
- All Implemented Interfaces:
WeightApproximator
This class is a weight approximation based on precalculated landmarks.
- Author:
- Peter Karich
-
Constructor Summary
ConstructorsConstructorDescriptionLMApproximator(Graph graph, Weighting lmWeighting, Weighting routingWeighting, int maxBaseNodes, LandmarkStorage lms, int activeCount, double factor, boolean reverse) -
Method Summary
Modifier and TypeMethodDescriptiondoubleapproximate(int v) static LMApproximatorforLandmarks(Graph g, Weighting weighting, LandmarkStorage lms, int activeLM) doublegetSlack()reverse()Makes a 'reverse' copy of itself to make it possible using the two objects independent e.g.setEpsilon(double epsilon) Increase approximation with higher epsilonvoidsetTo(int t) toString()
-
Constructor Details
-
LMApproximator
public LMApproximator(Graph graph, Weighting lmWeighting, Weighting routingWeighting, int maxBaseNodes, LandmarkStorage lms, int activeCount, double factor, boolean reverse)
-
-
Method Details
-
forLandmarks
public static LMApproximator forLandmarks(Graph g, Weighting weighting, LandmarkStorage lms, int activeLM) - Parameters:
weighting- the weighting used for the current path calculation, not necessarily the same that we used for the LM preparation. All edge weights must be larger or equal compared to those used for the preparation.
-
setEpsilon
Increase approximation with higher epsilon -
approximate
public double approximate(int v) - Specified by:
approximatein interfaceWeightApproximator- Returns:
- minimal weight of the specified currentNode to the 'to' node
-
setTo
public void setTo(int t) - 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
-
toString
-