Class AbstractWeighting

java.lang.Object
com.graphhopper.routing.weighting.AbstractWeighting
All Implemented Interfaces:
Weighting

public abstract class AbstractWeighting extends Object implements Weighting
Author:
Peter Karich
  • Field Details

  • Constructor Details

  • Method Details

    • calcEdgeMillis

      public long calcEdgeMillis(EdgeIteratorState edgeState, boolean reverse)
      Description copied from interface: Weighting
      This method calculates the time taken (in milliseconds) to travel along the specified edgeState. It is typically used for post-processing and on only a few thousand edges.
      Specified by:
      calcEdgeMillis in interface Weighting
    • calcTurnWeight

      public double calcTurnWeight(int inEdge, int viaNode, int outEdge)
      Specified by:
      calcTurnWeight in interface Weighting
    • calcTurnMillis

      public long calcTurnMillis(int inEdge, int viaNode, int outEdge)
      Specified by:
      calcTurnMillis in interface Weighting
    • hasTurnCosts

      public boolean hasTurnCosts()
      Description copied from interface: Weighting
      This method can be used to check whether or not this weighting returns turn costs (or if they are all zero). This is sometimes needed to do safety checks as not all graph algorithms can be run edge-based and might yield wrong results when turn costs are applied while running node-based.
      Specified by:
      hasTurnCosts in interface Weighting
    • toString

      public String toString()
      Overrides:
      toString in class Object