public static PrepareContractionHierarchies fromGraphHopperStorage(GraphHopperStorage ghStorage, Weighting weighting, TraversalMode traversalMode) { return new PrepareContractionHierarchies(ghStorage.getGraph(CHGraph.class, weighting), weighting, traversalMode); }
private PrepareContractionHierarchies createPrepareContractionHierarchies(GraphHopperStorage g, CHGraph lg, Weighting w) { g.freeze(); return new PrepareContractionHierarchies(lg, w, tMode); }
private RoutingAlgorithm createCHAlgo(GraphHopperStorage graph, CHGraph chGraph, boolean withSOD, AlgorithmOptions algorithmOptions) { PrepareContractionHierarchies ch = new PrepareContractionHierarchies( chGraph, algorithmOptions.getWeighting(), TraversalMode.NODE_BASED); if (!withSOD) { algorithmOptions.getHints().put("stall_on_demand", false); } return ch.createAlgo(chGraph, algorithmOptions); } }
Path p = new PrepareContractionHierarchies( g2, weighting, TraversalMode.NODE_BASED). createAlgo(g2, opts).calcPath(0, 7);
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), traversalMode); tmpPrepareCH.setParams(pMap); 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()) { 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); } }