public class TurnCostStorage extends Object
Like IntRefs on edges, this can in principle be used to store values of any kind.
In practice, the IntRefs are used to store generalized travel costs per turn cost relation per vehicle type. In practice, we only store 0 or infinity. (Can turn, or cannot turn.)
| Modifier and Type | Class and Description |
|---|---|
static interface |
TurnCostStorage.Iterator |
| Constructor and Description |
|---|
TurnCostStorage(BaseGraph baseGraph,
DataAccess turnCosts) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
TurnCostStorage |
create(long initBytes) |
void |
flush() |
double |
get(DecimalEncodedValue turnCostEnc,
int fromEdge,
int viaNode,
int toEdge) |
TurnCostStorage.Iterator |
getAllTurnCosts()
Returns an iterator over all entries.
|
long |
getCapacity() |
boolean |
isClosed() |
boolean |
loadExisting() |
void |
set(DecimalEncodedValue turnCostEnc,
int fromEdge,
int viaNode,
int toEdge,
double cost)
Sets the turn cost at the viaNode when going from "fromEdge" to "toEdge"
WARNING: It is tacitly assumed that for every encoder, this method is only called once per turn cost relation.
|
String |
toString() |
public TurnCostStorage(BaseGraph baseGraph, DataAccess turnCosts)
public TurnCostStorage create(long initBytes)
public void flush()
public void close()
public long getCapacity()
public boolean loadExisting()
public void set(DecimalEncodedValue turnCostEnc, int fromEdge, int viaNode, int toEdge, double cost)
public double get(DecimalEncodedValue turnCostEnc, int fromEdge, int viaNode, int toEdge)
public boolean isClosed()
public TurnCostStorage.Iterator getAllTurnCosts()
Copyright © 2012–2022. All rights reserved.