Package com.graphhopper.storage
Class CHStorageBuilder
java.lang.Object
com.graphhopper.storage.CHStorageBuilder
Builds a valid
CHStorage
, i.e. makes sure that
- a valid level is already set for nodeA/B when adding a shortcut nodeA-nodeB
- level(nodeB) > level(nodeA) for all added shortcuts, unless nodeA == nodeB, then level(nodeA) == level(nodeB)
- shortcuts are added such that they are sorted by level(nodeA)
- the 'last shortcut' for node n points to the last shortcut for which nodeA == n-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
addShortcutEdgeBased
(int a, int b, int accessFlags, double weight, int skippedEdge1, int skippedEdge2, int origKeyFirst, int origKeyLast) int
addShortcutNodeBased
(int a, int b, int accessFlags, double weight, int skippedEdge1, int skippedEdge2) void
replaceSkippedEdges
(IntUnaryOperator mapping) void
void
setLevel
(int node, int level) void
setLevelForAllNodes
(int level)
-
Constructor Details
-
CHStorageBuilder
-
-
Method Details
-
setLevel
public void setLevel(int node, int level) -
setLevelForAllNodes
public void setLevelForAllNodes(int level) -
setIdentityLevels
public void setIdentityLevels() -
addShortcutNodeBased
public int addShortcutNodeBased(int a, int b, int accessFlags, double weight, int skippedEdge1, int skippedEdge2) -
addShortcutEdgeBased
public int addShortcutEdgeBased(int a, int b, int accessFlags, double weight, int skippedEdge1, int skippedEdge2, int origKeyFirst, int origKeyLast) - Parameters:
origKeyFirst
- The first original edge key that is skipped by this shortcut *in the direction of the shortcut*. This definition assumes that edge-based shortcuts are one-directional, and they are. For example for the following shortcut edge from x to y: x->u->v->w->y , which skips the shortcuts x->v and v->y the first original edge key would be the one of the edge x->uorigKeyLast
- like origKeyFirst, but the last orig edge key, i.e. the key of w->y in above example
-
replaceSkippedEdges
-