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 TypeMethodDescriptionlong
calcTurnMillis
(int inEdge, int viaNode, int outEdge) double
calcTurnWeight
(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_COSTS
the u-turn costs will be infinite
-
-
Method Details
-
getTurnRestrictionEnc
-
calcTurnWeight
public double calcTurnWeight(int edgeFrom, int nodeVia, int edgeTo) - Specified by:
calcTurnWeight
in 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:
calcTurnMillis
in interfaceTurnCostProvider
- Returns:
- the time it takes to take a turn in milli-seconds
- See Also:
-
toString
-