public abstract class AbstractWeighting extends Object implements Weighting
| Modifier and Type | Field and Description |
|---|---|
protected BooleanEncodedValue |
accessEnc |
protected DecimalEncodedValue |
avSpeedEnc |
protected FlagEncoder |
flagEncoder |
INFINITE_U_TURN_COSTS| Modifier | Constructor and Description |
|---|---|
protected |
AbstractWeighting(FlagEncoder encoder) |
protected |
AbstractWeighting(FlagEncoder encoder,
TurnCostProvider turnCostProvider) |
| Modifier and Type | Method and Description |
|---|---|
long |
calcEdgeMillis(EdgeIteratorState edgeState,
boolean reverse)
This method calculates the time taken (in milli seconds) to travel along the specified edgeState.
|
abstract double |
calcEdgeWeight(EdgeIteratorState edgeState,
boolean reverse)
In most cases subclasses should only override this method to change the edge-weight.
|
long |
calcTurnMillis(int inEdge,
int viaNode,
int outEdge) |
double |
calcTurnWeight(int inEdge,
int viaNode,
int outEdge) |
boolean |
equals(Object obj) |
FlagEncoder |
getFlagEncoder() |
int |
hashCode() |
boolean |
hasTurnCosts()
This method can be used to check whether or not this weighting returns turn costs (or if they are all zero).
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetMinWeight, getNameprotected final FlagEncoder flagEncoder
protected final DecimalEncodedValue avSpeedEnc
protected final BooleanEncodedValue accessEnc
protected AbstractWeighting(FlagEncoder encoder)
protected AbstractWeighting(FlagEncoder encoder, TurnCostProvider turnCostProvider)
public abstract double calcEdgeWeight(EdgeIteratorState edgeState, boolean reverse)
TurnCostProvider implementation to the constructor instead.calcEdgeWeight in interface WeightingedgeState - the edge for which the weight should be calculatedreverse - if the specified edge is specified in reverse direction e.g. from the reverse
case of a bidirectional search.public long calcEdgeMillis(EdgeIteratorState edgeState, boolean reverse)
WeightingcalcEdgeMillis in interface Weightingpublic double calcTurnWeight(int inEdge,
int viaNode,
int outEdge)
calcTurnWeight in interface Weightingpublic long calcTurnMillis(int inEdge,
int viaNode,
int outEdge)
calcTurnMillis in interface Weightingpublic boolean hasTurnCosts()
WeightinghasTurnCosts in interface Weightingpublic FlagEncoder getFlagEncoder()
getFlagEncoder in interface WeightingCopyright © 2012–2020. All rights reserved.