public class CHStorage extends Object
This can be seen as an extension to a base graph: We assign a CH level to each nodes and add additional edges to the graph ('shortcuts'). The shortcuts need to be ordered in a certain way, but this is not enforced here.
| Modifier and Type | Class and Description |
|---|---|
static class |
CHStorage.LowWeightShortcut |
| Constructor and Description |
|---|
CHStorage(Directory dir,
String name,
int segmentSize,
boolean edgeBased) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
create()
Creates a new storage.
|
void |
debugPrint() |
void |
flush() |
boolean |
getBwdAccess(long shortcutPointer) |
long |
getCapacity() |
boolean |
getFwdAccess(long shortcutPointer) |
int |
getLastShortcut(long nodePointer) |
int |
getLevel(long nodePointer) |
int |
getNodeA(long shortcutPointer) |
int |
getNodeB(long shortcutPointer) |
NodeOrderingProvider |
getNodeOrderingProvider() |
int |
getNodes()
The number of nodes of this storage.
|
int |
getNumShortcutsExceedingWeight() |
int |
getOrigEdgeFirst(long shortcutPointer) |
int |
getOrigEdgeLast(long shortcutPointer) |
int |
getShortcuts()
The number of shortcuts that were added to this storage
|
int |
getSkippedEdge1(long shortcutPointer) |
int |
getSkippedEdge2(long shortcutPointer) |
double |
getWeight(long shortcutPointer) |
void |
init(int nodes,
int expectedShortcuts)
Initializes the storage.
|
boolean |
isClosed() |
boolean |
isEdgeBased() |
boolean |
loadExisting() |
void |
setLastShortcut(long nodePointer,
int shortcut) |
void |
setLevel(long nodePointer,
int level) |
void |
setLowShortcutWeightConsumer(Consumer<CHStorage.LowWeightShortcut> lowWeightShortcutConsumer)
Sets a callback called for shortcuts that are below the minimum weight.
|
void |
setOrigEdges(long shortcutPointer,
int origFirst,
int origLast) |
void |
setSkippedEdges(long shortcutPointer,
int edge1,
int edge2) |
void |
setWeight(long shortcutPointer,
double weight) |
int |
shortcutEdgeBased(int nodeA,
int nodeB,
int accessFlags,
double weight,
int skip1,
int skip2,
int origFirst,
int origLast) |
int |
shortcutNodeBased(int nodeA,
int nodeB,
int accessFlags,
double weight,
int skip1,
int skip2)
Adds a shortcut to the storage.
|
String |
toDetailsString() |
long |
toNodePointer(int node)
To use the node getters/setters you need to convert node IDs to a nodePointer first
|
long |
toShortcutPointer(int shortcut)
To use the shortcut getters/setters you need to convert shortcut IDs to an shortcutPointer first
|
public void setLowShortcutWeightConsumer(Consumer<CHStorage.LowWeightShortcut> lowWeightShortcutConsumer)
public void create()
loadExisting()}.public void init(int nodes,
int expectedShortcuts)
public void flush()
public boolean loadExisting()
public void close()
public int shortcutNodeBased(int nodeA,
int nodeB,
int accessFlags,
double weight,
int skip1,
int skip2)
public int shortcutEdgeBased(int nodeA,
int nodeB,
int accessFlags,
double weight,
int skip1,
int skip2,
int origFirst,
int origLast)
public int getNodes()
public int getShortcuts()
public long toNodePointer(int node)
public long toShortcutPointer(int shortcut)
public boolean isEdgeBased()
public int getLastShortcut(long nodePointer)
public void setLastShortcut(long nodePointer,
int shortcut)
public int getLevel(long nodePointer)
public void setLevel(long nodePointer,
int level)
public void setWeight(long shortcutPointer,
double weight)
public void setSkippedEdges(long shortcutPointer,
int edge1,
int edge2)
public void setOrigEdges(long shortcutPointer,
int origFirst,
int origLast)
public int getNodeA(long shortcutPointer)
public int getNodeB(long shortcutPointer)
public boolean getFwdAccess(long shortcutPointer)
public boolean getBwdAccess(long shortcutPointer)
public double getWeight(long shortcutPointer)
public int getSkippedEdge1(long shortcutPointer)
public int getSkippedEdge2(long shortcutPointer)
public int getOrigEdgeFirst(long shortcutPointer)
public int getOrigEdgeLast(long shortcutPointer)
public NodeOrderingProvider getNodeOrderingProvider()
public void debugPrint()
public long getCapacity()
public int getNumShortcutsExceedingWeight()
public String toDetailsString()
public boolean isClosed()
Copyright © 2012–2021. All rights reserved.