Package com.graphhopper.routing
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 Summary
FieldsModifier and TypeFieldDescriptionprotected final RoutingCHGraph
protected RoutingCHEdgeExplorer
protected CHEdgeFilter
protected final NodeAccess
protected RoutingCHEdgeExplorer
Fields inherited from class com.graphhopper.routing.AbstractBidirAlgo
bestBwdEntry, bestFwdEntry, bestWeight, bestWeightMapFrom, bestWeightMapOther, bestWeightMapTo, currFrom, currTo, finishedFrom, finishedTo, from, fromOutEdge, maxVisitedNodes, timeoutMillis, to, toInEdge, traversalMode, updateBestPath
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
accept
(RoutingCHEdgeIteratorState edge, SPTEntry currEdge, boolean reverse) protected double
calcWeight
(RoutingCHEdgeIteratorState edgeState, boolean reverse, int prevOrNextEdgeId) protected double
calcWeight
(RoutingCHEdgeIteratorState iter, SPTEntry currEdge, boolean reverse) protected Path
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 (aSPTEntry
or one of its subclasses) during a dijkstra expansion.protected Path
protected void
fillEdgesFromUsingFilter
(CHEdgeFilter edgeFilter) protected void
fillEdgesToUsingFilter
(CHEdgeFilter edgeFilter) boolean
finished()
protected double
getInEdgeWeight
(SPTEntry entry) protected void
initCollections
(int size) protected void
protected void
void
setPathExtractorSupplier
(Supplier<BidirPathExtractor> pathExtractorSupplier) toString()
protected void
updateEntry
(SPTEntry entry, int edge, int adjNode, int incEdge, double weight, SPTEntry parent, boolean reverse) Methods inherited from class com.graphhopper.routing.AbstractBidirAlgo
bwdSearchCanBeStopped, calcPath, calcPath, calcPaths, checkAlreadyRun, createStartEntry, fromEntryCanBeSkipped, fwdSearchCanBeStopped, getCurrentFromWeight, getCurrentToWeight, getIncomingEdge, getName, getVisitedNodes, initFrom, initTo, isMaxVisitedNodesExceeded, isTimeoutExceeded, postInit, runAlgo, setMaxVisitedNodes, setTimeoutMillis, setUpdateBestPath, setupFinishTime, toEntryCanBeSkipped, updateBestPath
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.graphhopper.routing.EdgeToEdgeRoutingAlgorithm
calcPath
Methods inherited from interface com.graphhopper.routing.RoutingAlgorithm
calcPath, calcPaths, getName, getVisitedNodes, setMaxVisitedNodes, setTimeoutMillis
-
Field Details
-
graph
-
nodeAccess
-
inEdgeExplorer
-
outEdgeExplorer
-
levelEdgeFilter
-
-
Constructor Details
-
AbstractBidirCHAlgo
-
-
Method Details
-
initCollections
protected void initCollections(int size) - Overrides:
initCollections
in classAbstractBidirAlgo
-
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 (aSPTEntry
or one of its subclasses) during a dijkstra expansion.- Parameters:
edge
- the id of the edge that is currently processed for the expansionadjNode
- the adjacent node of the edgeincEdge
- 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 nodeweight
- the weight the shortest path three entry should carryparent
- the parent entry of in the shortest path treereverse
- true if we are currently looking at the backward search, false otherwise
-
postInitFrom
protected void postInitFrom()- Specified by:
postInitFrom
in classAbstractBidirAlgo
-
postInitTo
protected void postInitTo()- Specified by:
postInitTo
in classAbstractBidirAlgo
-
fillEdgesFromUsingFilter
- Parameters:
edgeFilter
- edge filter used to fill edges. thelevelEdgeFilter
reference will be set to edgeFilter by this method, so make sure edgeFilter does not use it directly.
-
fillEdgesToUsingFilter
- See Also:
-
finished
public boolean finished()- Overrides:
finished
in classAbstractBidirAlgo
-
calcWeight
protected double calcWeight(RoutingCHEdgeIteratorState edgeState, boolean reverse, int prevOrNextEdgeId) -
updateEntry
-
accept
-
calcWeight
-
getInEdgeWeight
- Specified by:
getInEdgeWeight
in classAbstractBidirAlgo
-
extractPath
- Specified by:
extractPath
in classAbstractBidirAlgo
-
setPathExtractorSupplier
-
createEmptyPath
-
toString
-