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()) { PrepareContractionHierarchies tmpPrepareCH = new PrepareContractionHierarchies( new GHDirectory("", DAType.RAM_INT), ghStorage, ghStorage.getGraph(CHGraph.class, weighting), weighting.getFlagEncoder(), weighting, traversalMode); tmpPrepareCH.setPeriodicUpdates(preparationPeriodicUpdates). setLazyUpdates(preparationLazyUpdates). setNeighborUpdates(preparationNeighborUpdates). setLogMessages(preparationLogMessages); addPreparation(tmpPrepareCH); } }
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); } }