Class DefaultTurnCostProvider
java.lang.Object
com.graphhopper.routing.weighting.DefaultTurnCostProvider
- All Implemented Interfaces:
TurnCostProvider
-
Field Summary
Fields inherited from interface com.graphhopper.routing.weighting.TurnCostProvider
NO_TURN_COST_PROVIDER -
Constructor Summary
ConstructorsConstructorDescriptionDefaultTurnCostProvider(BooleanEncodedValue turnRestrictionEnc, TurnCostStorage turnCostStorage) DefaultTurnCostProvider(BooleanEncodedValue turnRestrictionEnc, TurnCostStorage turnCostStorage, int uTurnCosts) -
Method Summary
Modifier and TypeMethodDescriptionlongcalcTurnMillis(int inEdge, int viaNode, int outEdge) doublecalcTurnWeight(int edgeFrom, int nodeVia, int edgeTo) toString()
-
Constructor Details
-
DefaultTurnCostProvider
public DefaultTurnCostProvider(BooleanEncodedValue turnRestrictionEnc, TurnCostStorage turnCostStorage) -
DefaultTurnCostProvider
public DefaultTurnCostProvider(BooleanEncodedValue turnRestrictionEnc, TurnCostStorage turnCostStorage, int uTurnCosts) - Parameters:
uTurnCosts- the costs of a u-turn in seconds, forTurnCostsConfig.INFINITE_U_TURN_COSTSthe u-turn costs will be infinite
-
-
Method Details
-
getTurnRestrictionEnc
-
calcTurnWeight
public double calcTurnWeight(int edgeFrom, int nodeVia, int edgeTo) - Specified by:
calcTurnWeightin interfaceTurnCostProvider- Returns:
- the turn weight of a transitions from the edge with id to the edge with id at the node with id
-
calcTurnMillis
public long calcTurnMillis(int inEdge, int viaNode, int outEdge) - Specified by:
calcTurnMillisin interfaceTurnCostProvider- Returns:
- the time it takes to take a turn in milli-seconds
- See Also:
-
toString
-