public abstract class AbstractWeighting extends Object implements Weighting
| Modifier and Type | Field and Description |
|---|---|
protected BooleanEncodedValue |
accessEnc |
protected DecimalEncodedValue |
speedEnc |
INFINITE_U_TURN_COSTS| Modifier | Constructor and Description |
|---|---|
protected |
AbstractWeighting(BooleanEncodedValue accessEnc,
DecimalEncodedValue speedEnc,
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 |
edgeHasNoAccess(EdgeIteratorState edgeState,
boolean reverse) |
TurnCostProvider |
getTurnCostProvider() |
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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcalcEdgeWeightWithAccess, getMinWeight, getNameprotected final BooleanEncodedValue accessEnc
protected final DecimalEncodedValue speedEnc
protected AbstractWeighting(BooleanEncodedValue accessEnc, DecimalEncodedValue speedEnc, TurnCostProvider turnCostProvider)
public boolean edgeHasNoAccess(EdgeIteratorState edgeState, boolean reverse)
edgeHasNoAccess in interface Weightingpublic 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 TurnCostProvider getTurnCostProvider()
Copyright © 2012–2022. All rights reserved.