Skip to content

Commit

Permalink
Revert "Adjust signature of GraphHopper#createTurnWeighting"
Browse files Browse the repository at this point in the history
This reverts commit cf309c4
  • Loading branch information
easbar committed Oct 22, 2019
1 parent cf309c4 commit 643ddbc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/main/java/com/graphhopper/GraphHopper.java
Expand Up @@ -935,10 +935,10 @@ public Weighting createWeighting(HintsMap hintsMap, FlagEncoder encoder, Graph g
/**
* Potentially wraps the specified weighting into a TurnWeighting instance.
*/
public Weighting createTurnWeighting(Weighting weighting, TurnCostExtension turnCostExtension, TraversalMode tMode, double uTurnCosts) {
public Weighting createTurnWeighting(Graph graph, Weighting weighting, TraversalMode tMode, double uTurnCosts) {
FlagEncoder encoder = weighting.getFlagEncoder();
if (encoder.supports(TurnWeighting.class) && tMode.isEdgeBased())
return new TurnWeighting(weighting, turnCostExtension, uTurnCosts);
return new TurnWeighting(weighting, (TurnCostExtension) graph.getExtension(), uTurnCosts);
return weighting;
}

Expand Down Expand Up @@ -1062,7 +1062,7 @@ else if (ALT_ROUTE.equalsIgnoreCase(algoStr))
throw new IllegalArgumentException("Finite u-turn costs can only be used for edge-based routing, use `" + Routing.EDGE_BASED + "=true'");
}
double uTurnCosts = uTurnCostInt == INFINITE_U_TURN_COSTS ? Double.POSITIVE_INFINITY : uTurnCostInt;
weighting = createTurnWeighting(weighting, (TurnCostExtension) queryGraph.getExtension(), tMode, uTurnCosts);
weighting = createTurnWeighting(queryGraph, weighting, tMode, uTurnCosts);

AlgorithmOptions algoOpts = AlgorithmOptions.start().
algorithm(algoStr).traversalMode(tMode).weighting(weighting).
Expand Down

0 comments on commit 643ddbc

Please sign in to comment.