Class PerfectApproximator

java.lang.Object
com.graphhopper.routing.lm.PerfectApproximator
All Implemented Interfaces:
WeightApproximator

public class PerfectApproximator extends Object implements WeightApproximator
Just a sanity-check implementation for WeightApproximator, which 'approximates' perfectly.
  • Constructor Details

  • Method Details

    • approximate

      public double approximate(int currentNode)
      Specified by:
      approximate in interface WeightApproximator
      Returns:
      minimal weight of the specified currentNode to the 'to' node
    • setTo

      public void setTo(int to)
      Specified by:
      setTo in interface WeightApproximator
    • reverse

      public WeightApproximator 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 interface WeightApproximator
    • getSlack

      public double getSlack()
      Specified by:
      getSlack in interface WeightApproximator