public GraphHopper() { chFactoryDecorator.setEnabled(true); lmFactoryDecorator.setEnabled(false); // order is important to use CH as base algo and set the approximation in the followed lm factory decorator algoDecorators.add(chFactoryDecorator); algoDecorators.add(lmFactoryDecorator); }
/** * Enables or disables contraction hierarchies (CH). This speed-up mode is enabled by default. */ public GraphHopper setCHEnabled(boolean enable) { ensureNotLoaded(); chFactoryDecorator.setEnabled(enable); return this; }
@Override public void init(CmdArgs args) { // throw explicit error for deprecated configs if (!args.get("prepare.threads", "").isEmpty()) throw new IllegalStateException("Use " + CH.PREPARE + "threads instead of prepare.threads"); if (!args.get("prepare.chWeighting", "").isEmpty() || !args.get("prepare.chWeightings", "").isEmpty()) throw new IllegalStateException("Use " + CH.PREPARE + "weightings and a comma separated list instead of prepare.chWeighting or prepare.chWeightings"); setPreparationThreads(args.getInt(CH.PREPARE + "threads", getPreparationThreads())); // default is enabled & fastest String chWeightingsStr = args.get(CH.PREPARE + "weightings", ""); if ("no".equals(chWeightingsStr) || "false".equals(chWeightingsStr)) { // default is fastest and we need to clear this explicitly weightingsAsStrings.clear(); } else if (!chWeightingsStr.isEmpty()) { List<String> tmpCHWeightingList = Arrays.asList(chWeightingsStr.split(",")); setWeightingsAsStrings(tmpCHWeightingList); } boolean enableThis = !weightingsAsStrings.isEmpty(); setEnabled(enableThis); if (enableThis) setDisablingAllowed(args.getBool(CH.INIT_DISABLING_ALLOWED, isDisablingAllowed())); pMap = args; }
@Test public void testCreatePreparations() { CHAlgoFactoryDecorator instance = new CHAlgoFactoryDecorator(); assertFalse(instance.isDisablingAllowed()); instance.setEnabled(false); assertTrue(instance.isDisablingAllowed()); } }
public GraphHopper() { chFactoryDecorator.setEnabled(true); algoDecorators.add(chFactoryDecorator); }
/** * Enables or disables contraction hierarchies (CH). This speed-up mode is enabled by default. */ public GraphHopper setCHEnabled( boolean enable ) { ensureNotLoaded(); chFactoryDecorator.setEnabled(enable); return this; }
public GraphHopper() { chFactoryDecorator.setEnabled(true); lmFactoryDecorator.setEnabled(false); // order is important to use CH as base algo and set the approximation in the followed lm factory decorator algoDecorators.add(chFactoryDecorator); algoDecorators.add(lmFactoryDecorator); }
public GraphHopper() { chFactoryDecorator.setEnabled(true); lmFactoryDecorator.setEnabled(false); // order is important to use CH as base algo and set the approximation in the followed lm factory decorator algoDecorators.add(chFactoryDecorator); algoDecorators.add(lmFactoryDecorator); }
/** * Enables or disables contraction hierarchies (CH). This speed-up mode is enabled by default. */ public GraphHopper setCHEnabled(boolean enable) { ensureNotLoaded(); chFactoryDecorator.setEnabled(enable); return this; }
/** * Enables or disables contraction hierarchies (CH). This speed-up mode is enabled by default. */ public GraphHopper setCHEnabled(boolean enable) { ensureNotLoaded(); chFactoryDecorator.setEnabled(enable); return this; }
@Override public void init(CmdArgs args) { // throw explicit error for deprecated configs if (!args.get("prepare.threads", "").isEmpty()) throw new IllegalStateException("Use " + CH.PREPARE + "threads instead of prepare.threads"); if (!args.get("prepare.chWeighting", "").isEmpty() || !args.get("prepare.chWeightings", "").isEmpty()) throw new IllegalStateException("Use " + CH.PREPARE + "weightings and a comma separated list instead of prepare.chWeighting or prepare.chWeightings"); setPreparationThreads(args.getInt(CH.PREPARE + "threads", getPreparationThreads())); // default is enabled & fastest String chWeightingsStr = args.get(CH.PREPARE + "weightings", ""); if ("no".equals(chWeightingsStr) || "false".equals(chWeightingsStr)) { // default is fastest and we need to clear this explicitly weightingsAsStrings.clear(); } else if (!chWeightingsStr.isEmpty()) { List<String> tmpCHWeightingList = Arrays.asList(chWeightingsStr.split(",")); setWeightingsAsStrings(tmpCHWeightingList); } boolean enableThis = !weightingsAsStrings.isEmpty(); setEnabled(enableThis); if (enableThis) setDisablingAllowed(args.getBool(CH.INIT_DISABLING_ALLOWED, isDisablingAllowed())); pMap = args; }
graphHopper.getCHFactoryDecorator().setEnabled(false); graphHopper.getCHFactoryDecorator().setDisablingAllowed(true); graphHopper.importOrLoad();
@Override public void init(CmdArgs args) { // throw explicit error for deprecated configs if (!args.get("prepare.threads", "").isEmpty()) throw new IllegalStateException("Use " + CH.PREPARE + "threads instead of prepare.threads"); if (!args.get("prepare.chWeighting", "").isEmpty() || !args.get("prepare.chWeightings", "").isEmpty()) throw new IllegalStateException("Use " + CH.PREPARE + "weightings and a comma separated list instead of prepare.chWeighting or prepare.chWeightings"); setPreparationThreads(args.getInt(CH.PREPARE + "threads", getPreparationThreads())); // default is enabled & fastest String chWeightingsStr = args.get(CH.PREPARE + "weightings", ""); if ("no".equals(chWeightingsStr)) { // default is fastest and we need to clear this explicitely weightingsAsStrings.clear(); } else if (!chWeightingsStr.isEmpty()) { List<String> tmpCHWeightingList = Arrays.asList(chWeightingsStr.split(",")); setWeightingsAsStrings(tmpCHWeightingList); } boolean enableThis = !weightingsAsStrings.isEmpty(); setEnabled(enableThis); if (enableThis) setDisablingAllowed(args.getBool(CH.INIT_DISABLING_ALLOWED, isDisablingAllowed())); setPreparationPeriodicUpdates(args.getInt(CH.PREPARE + "updates.periodic", getPreparationPeriodicUpdates())); setPreparationLazyUpdates(args.getInt(CH.PREPARE + "updates.lazy", getPreparationLazyUpdates())); setPreparationNeighborUpdates(args.getInt(CH.PREPARE + "updates.neighbor", getPreparationNeighborUpdates())); setPreparationContractedNodes(args.getInt(CH.PREPARE + "contracted_nodes", getPreparationContractedNodes())); setPreparationLogMessages(args.getDouble(CH.PREPARE + "log_messages", getPreparationLogMessages())); }
public void init( CmdArgs args ) { setPreparationThreads(args.getInt("prepare.threads", getPreparationThreads())); String deprecatedWeightingConfig = args.get("prepare.chWeighting", ""); if (!deprecatedWeightingConfig.isEmpty()) throw new IllegalStateException("Use prepare.ch.weightings and a comma separated list instead of prepare.chWeighting"); // default is enabled & fastest String chWeightingsStr = args.get("prepare.ch.weightings", ""); // backward compatibility if (chWeightingsStr.isEmpty()) chWeightingsStr = args.get("prepare.chWeightings", ""); if ("no".equals(chWeightingsStr)) { // default is fastest and we need to clear this explicitely weightingsAsStrings.clear(); } else if (!chWeightingsStr.isEmpty()) { List<String> tmpCHWeightingList = Arrays.asList(chWeightingsStr.split(",")); setWeightingsAsStrings(tmpCHWeightingList); } boolean enableThis = !weightingsAsStrings.isEmpty(); setEnabled(enableThis); if (enableThis) setDisablingAllowed(args.getBool(CH.INIT_DISABLING_ALLOWED, isDisablingAllowed())); setPreparationPeriodicUpdates(args.getInt("prepare.updates.periodic", getPreparationPeriodicUpdates())); setPreparationLazyUpdates(args.getInt("prepare.updates.lazy", getPreparationLazyUpdates())); setPreparationNeighborUpdates(args.getInt("prepare.updates.neighbor", getPreparationNeighborUpdates())); setPreparationContractedNodes(args.getInt("prepare.contracted_nodes", getPreparationContractedNodes())); setPreparationLogMessages(args.getDouble("prepare.log_messages", getPreparationLogMessages())); }
graphHopperConfiguration.put("graph.location", "graph-cache"); GraphHopper hopper = new GraphHopperOSM().init(graphHopperConfiguration); hopper.getCHFactoryDecorator().setEnabled(false); System.out.println("loading graph from cache"); hopper.load(graphHopperConfiguration.get("graph.location", "graph-cache"));
@Override public void run(Bootstrap<?> bootstrap, Namespace args) { CmdArgs graphHopperConfiguration = new CmdArgs(); graphHopperConfiguration.put("graph.flag_encoders", args.getString("vehicle")); graphHopperConfiguration.put("datareader.file", args.getString("datasource")); graphHopperConfiguration.put("graph.location", "graph-cache"); GraphHopper hopper = new GraphHopperOSM().init(graphHopperConfiguration); hopper.getCHFactoryDecorator().setEnabled(false); hopper.importOrLoad(); }
args.put("prepare.min_one_way_network_size", 200); GraphHopper hopper = new GraphHopper().init(args); hopper.getCHFactoryDecorator().setEnabled(false); hopper.importOrLoad(); hopper.getCHFactoryDecorator().setEnabled(false); logger.info("loading graph from cache"); hopper.load("./graph-cache");