Class AbstractBidirCHAlgo

java.lang.Object
com.graphhopper.routing.AbstractBidirAlgo
com.graphhopper.routing.AbstractBidirCHAlgo
All Implemented Interfaces:
EdgeToEdgeRoutingAlgorithm, RoutingAlgorithm
Direct Known Subclasses:
AbstractBidirectionEdgeCHNoSOD, AStarBidirectionCH, DijkstraBidirectionCHNoSOD

public abstract class AbstractBidirCHAlgo extends AbstractBidirAlgo implements EdgeToEdgeRoutingAlgorithm
Common subclass for bidirectional CH algorithms.

Author:
Peter Karich, easbar
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • initCollections

      protected void initCollections(int size)
      Overrides:
      initCollections in class AbstractBidirAlgo
    • createEntry

      protected abstract SPTEntry createEntry(int edge, int adjNode, int incEdge, double weight, SPTEntry parent, boolean reverse)
      Creates a new entry of the shortest path tree (a SPTEntry or one of its subclasses) during a dijkstra expansion.
      Parameters:
      edge - the id of the edge that is currently processed for the expansion
      adjNode - the adjacent node of the edge
      incEdge - the id of the edge that is incoming to the node the edge is pointed at. usually this is the same as edge, but for edge-based CH and in case edge corresponds to a shortcut incEdge is the original edge that is incoming to the node
      weight - the weight the shortest path three entry should carry
      parent - the parent entry of in the shortest path tree
      reverse - true if we are currently looking at the backward search, false otherwise
    • postInitFrom

      protected void postInitFrom()
      Specified by:
      postInitFrom in class AbstractBidirAlgo
    • postInitTo

      protected void postInitTo()
      Specified by:
      postInitTo in class AbstractBidirAlgo
    • fillEdgesFromUsingFilter

      protected void fillEdgesFromUsingFilter(CHEdgeFilter edgeFilter)
      Parameters:
      edgeFilter - edge filter used to fill edges. the levelEdgeFilter reference will be set to edgeFilter by this method, so make sure edgeFilter does not use it directly.
    • fillEdgesToUsingFilter

      protected void fillEdgesToUsingFilter(CHEdgeFilter edgeFilter)
      See Also:
    • finished

      public boolean finished()
      Overrides:
      finished in class AbstractBidirAlgo
    • calcWeight

      protected double calcWeight(RoutingCHEdgeIteratorState edgeState, boolean reverse, int prevOrNextEdgeId)
    • updateEntry

      protected void updateEntry(SPTEntry entry, int edge, int adjNode, int incEdge, double weight, SPTEntry parent, boolean reverse)
    • accept

      protected boolean accept(RoutingCHEdgeIteratorState edge, SPTEntry currEdge, boolean reverse)
    • calcWeight

      protected double calcWeight(RoutingCHEdgeIteratorState iter, SPTEntry currEdge, boolean reverse)
    • getInEdgeWeight

      protected double getInEdgeWeight(SPTEntry entry)
      Specified by:
      getInEdgeWeight in class AbstractBidirAlgo
    • extractPath

      protected Path extractPath()
      Specified by:
      extractPath in class AbstractBidirAlgo
    • setPathExtractorSupplier

      public void setPathExtractorSupplier(Supplier<BidirPathExtractor> pathExtractorSupplier)
    • createEmptyPath

      protected Path createEmptyPath()
    • toString

      public String toString()
      Overrides:
      toString in class Object