Package com.graphhopper.routing.ch
Class CHPreparationGraph
java.lang.Object
com.graphhopper.routing.ch.CHPreparationGraph
Graph data structure used for CH preparation. It allows caching weights, and edges that are not needed anymore
(those adjacent to contracted nodes) can be removed (see
disconnect(int).- Author:
- easbar
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interface -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEdge(int from, int to, int edge, double weightFwd, double weightBwd) intaddShortcut(int from, int to, int origEdgeKeyFirst, int origEdgeKeyLast, int skipped1, int skipped2, double weight, int origEdgeCount) static voidbuildFromGraph(CHPreparationGraph prepareGraph, Graph graph, Weighting weighting) buildTurnCostFunctionFromTurnCostStorage(Graph graph, Weighting weighting) voidclose()com.carrotsearch.hppc.IntContainerdisconnect(int node) static CHPreparationGraphedgeBased(int nodes, int edges, CHPreparationGraph.TurnCostFunction turnCostFunction) intgetDegree(int node) intgetNodes()intintgetShortcutForPrepareEdge(int prepareEdge) doublegetTurnWeight(int inEdgeKey, int viaNode, int outEdgeKey) static CHPreparationGraphnodeBased(int nodes, int edges) voidvoidsetShortcutForPrepareEdge(int prepareEdge, int shortcut)
-
Method Details
-
nodeBased
-
edgeBased
public static CHPreparationGraph edgeBased(int nodes, int edges, CHPreparationGraph.TurnCostFunction turnCostFunction) -
buildFromGraph
public static void buildFromGraph(CHPreparationGraph prepareGraph, Graph graph, Weighting weighting) -
buildTurnCostFunctionFromTurnCostStorage
public static CHPreparationGraph.TurnCostFunction buildTurnCostFunctionFromTurnCostStorage(Graph graph, Weighting weighting) -
getNodes
public int getNodes() -
getOriginalEdges
public int getOriginalEdges() -
getDegree
public int getDegree(int node) -
addEdge
public void addEdge(int from, int to, int edge, double weightFwd, double weightBwd) -
addShortcut
public int addShortcut(int from, int to, int origEdgeKeyFirst, int origEdgeKeyLast, int skipped1, int skipped2, double weight, int origEdgeCount) -
prepareForContraction
public void prepareForContraction() -
setShortcutForPrepareEdge
public void setShortcutForPrepareEdge(int prepareEdge, int shortcut) -
getShortcutForPrepareEdge
public int getShortcutForPrepareEdge(int prepareEdge) -
createOutEdgeExplorer
-
createInEdgeExplorer
-
createOutOrigEdgeExplorer
-
createInOrigEdgeExplorer
-
getTurnWeight
public double getTurnWeight(int inEdgeKey, int viaNode, int outEdgeKey) -
disconnect
public com.carrotsearch.hppc.IntContainer disconnect(int node) -
close
public void close()
-