public CHAlgoFactoryDecorator setWeightingsAsStrings(String... weightingNames) { return setWeightingsAsStrings(Arrays.asList(weightingNames)); }
public CHAlgoFactoryDecorator() { setPreparationThreads(1); setWeightingsAsStrings(Arrays.asList(getDefaultWeighting())); }
@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; }
public CHAlgoFactoryDecorator setWeightingsAsStrings(String... weightingNames) { return setWeightingsAsStrings(Arrays.asList(weightingNames)); }
public CHAlgoFactoryDecorator setWeightingsAsStrings( String... weightingNames ) { return setWeightingsAsStrings(Arrays.asList(weightingNames)); }
public CHAlgoFactoryDecorator setWeightingsAsStrings(String... weightingNames) { return setWeightingsAsStrings(Arrays.asList(weightingNames)); }
/** * Enables the use of contraction hierarchies to reduce query times. Enabled by default. * * @param weightingList A list containing multiple weightings like: "fastest", "shortest" or * your own weight-calculation type. * * @deprecated Use getCHFactoryDecorator().setWeightingsAsStrings() instead. Will be removed in * 0.8. */ public GraphHopper setCHWeightings( List<String> weightingList ) { ensureNotLoaded(); chFactoryDecorator.setWeightingsAsStrings(weightingList); return this; }
public CHAlgoFactoryDecorator() { setPreparationThreads(1); setWeightingsAsStrings(Arrays.asList(getDefaultWeighting())); }
public CHAlgoFactoryDecorator() { setPreparationThreads(1); setWeightingsAsStrings(Arrays.asList(getDefaultWeighting())); }
public CHAlgoFactoryDecorator() { setPreparationThreads(1); setWeightingsAsStrings(Arrays.asList(getDefaultWeighting())); }
@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; }
@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())); }