use of com.graphhopper.routing.weighting.GenericWeighting in project graphhopper by graphhopper.
the class CHAlgoFactoryDecorator method createPreparations.
public void createPreparations(GraphHopperStorage ghStorage, TraversalMode traversalMode) {
if (!isEnabled() || !preparations.isEmpty())
return;
if (weightings.isEmpty())
throw new IllegalStateException("No CH weightings found");
traversalMode = getNodeBase();
for (Weighting weighting : getWeightings()) {
if (weighting instanceof GenericWeighting) {
((GenericWeighting) weighting).setGraph(ghStorage);
}
PrepareContractionHierarchies tmpPrepareCH = new PrepareContractionHierarchies(new GHDirectory("", DAType.RAM_INT), ghStorage, ghStorage.getGraph(CHGraph.class, weighting), weighting, traversalMode);
tmpPrepareCH.setPeriodicUpdates(preparationPeriodicUpdates).setLazyUpdates(preparationLazyUpdates).setNeighborUpdates(preparationNeighborUpdates).setLogMessages(preparationLogMessages);
addPreparation(tmpPrepareCH);
}
}
Aggregations