/** * Convenient constructor if only one parameter is provided */ public HintsMap(String weighting) { super(5); setWeighting(weighting); }
/** * By default it supports fastest and shortest. Or specify empty to use default. */ public GHRequest setWeighting(String w) { hints.setWeighting(w); return this; }
@Override public RoutingAlgorithmFactory getDecoratedAlgorithmFactory(RoutingAlgorithmFactory defaultAlgoFactory, HintsMap map) { boolean disableCH = map.getBool(DISABLE, false); if (!isEnabled() || disablingAllowed && disableCH) return defaultAlgoFactory; if (preparations.isEmpty()) throw new IllegalStateException("No preparations added to this decorator"); if (map.getWeighting().isEmpty()) map.setWeighting(getDefaultWeighting()); String entriesStr = ""; for (PrepareContractionHierarchies p : preparations) { if (p.getWeighting().matches(map)) return p; entriesStr += p.getWeighting() + ", "; } throw new IllegalArgumentException("Cannot find CH RoutingAlgorithmFactory for weighting map " + map + " in entries " + entriesStr); }
Collection<AlgoHelperEntry> prepares = createAlgos(hopper, new HintsMap().setWeighting("shortest").setVehicle("car"), TraversalMode.NODE_BASED);
.setVehicle(hints.getVehicle()).setWeighting(hints.getWeighting());
/** * By default it supports fastest and shortest. Or specify empty to use default. */ public GHRequest setWeighting( String w ) { hints.setWeighting(w); return this; }
/** * Convenient constructor if only one parameter is provided */ public HintsMap(String weighting) { super(5); setWeighting(weighting); }
/** * By default it supports fastest and shortest. Or specify empty to use default. */ public GHRequest setWeighting(String w) { hints.setWeighting(w); return this; }
/** * Convenient constructor if only one parameter is provided * <p> */ public HintsMap( String weighting ) { super(5); setWeighting(weighting); }
/** * By default it supports fastest and shortest. Or specify empty to use default. */ public GHRequest setWeighting(String w) { hints.setWeighting(w); return this; }
/** * Convenient constructor if only one parameter is provided */ public HintsMap(String weighting) { super(5); setWeighting(weighting); }
@Override public RoutingAlgorithmFactory getDecoratedAlgorithmFactory( RoutingAlgorithmFactory defaultAlgoFactory, HintsMap map ) { boolean forceFlexMode = map.getBool(DISABLE, false); if (!isEnabled() || forceFlexMode) return defaultAlgoFactory; if (preparations.isEmpty()) throw new IllegalStateException("No preparations added to this decorator"); if (map.getWeighting().isEmpty()) map.setWeighting(getDefaultWeighting()); for (PrepareContractionHierarchies p : preparations) { if (p.getWeighting().matches(map)) return p; } throw new IllegalArgumentException("Cannot find RoutingAlgorithmFactory for weighting map " + map); }
@Override public RoutingAlgorithmFactory getDecoratedAlgorithmFactory(RoutingAlgorithmFactory defaultAlgoFactory, HintsMap map) { boolean forceFlexMode = map.getBool(DISABLE, false); if (!isEnabled() || forceFlexMode) return defaultAlgoFactory; if (preparations.isEmpty()) throw new IllegalStateException("No preparations added to this decorator"); if (map.getWeighting().isEmpty()) map.setWeighting(getDefaultWeighting()); String entriesStr = ""; for (PrepareContractionHierarchies p : preparations) { if (p.getWeighting().matches(map)) return p; entriesStr += p.getWeighting() + ", "; } throw new IllegalArgumentException("Cannot find CH RoutingAlgorithmFactory for weighting map " + map + " in entries " + entriesStr); }
@Override public RoutingAlgorithmFactory getDecoratedAlgorithmFactory(RoutingAlgorithmFactory defaultAlgoFactory, HintsMap map) { boolean disableCH = map.getBool(DISABLE, false); if (!isEnabled() || disablingAllowed && disableCH) return defaultAlgoFactory; if (preparations.isEmpty()) throw new IllegalStateException("No preparations added to this decorator"); if (map.getWeighting().isEmpty()) map.setWeighting(getDefaultWeighting()); String entriesStr = ""; for (PrepareContractionHierarchies p : preparations) { if (p.getWeighting().matches(map)) return p; entriesStr += p.getWeighting() + ", "; } throw new IllegalArgumentException("Cannot find CH RoutingAlgorithmFactory for weighting map " + map + " in entries " + entriesStr); }