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 class
static interface
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEdge
(int from, int to, int edge, double weightFwd, double weightBwd) int
addShortcut
(int from, int to, int origEdgeKeyFirst, int origEdgeKeyLast, int skipped1, int skipped2, double weight, int origEdgeCount) static void
buildFromGraph
(CHPreparationGraph prepareGraph, Graph graph, Weighting weighting) buildTurnCostFunctionFromTurnCostStorage
(Graph graph, Weighting weighting) void
close()
com.carrotsearch.hppc.IntContainer
disconnect
(int node) static CHPreparationGraph
edgeBased
(int nodes, int edges, CHPreparationGraph.TurnCostFunction turnCostFunction) int
getDegree
(int node) int
getNodes()
int
int
getShortcutForPrepareEdge
(int prepareEdge) double
getTurnWeight
(int inEdgeKey, int viaNode, int outEdgeKey) static CHPreparationGraph
nodeBased
(int nodes, int edges) void
void
setShortcutForPrepareEdge
(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()
-