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, wait
getMinWeight, getName
protected 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 Weighting
edgeState
- 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)
Weighting
calcEdgeMillis
in interface Weighting
public double calcTurnWeight(int inEdge, int viaNode, int outEdge)
calcTurnWeight
in interface Weighting
public long calcTurnMillis(int inEdge, int viaNode, int outEdge)
calcTurnMillis
in interface Weighting
public boolean hasTurnCosts()
Weighting
hasTurnCosts
in interface Weighting
public FlagEncoder getFlagEncoder()
getFlagEncoder
in interface Weighting
Copyright © 2012–2020. All rights reserved.