public CHAlgoFactoryDecorator() { setPreparationThreads(1); setWeightingsAsStrings(Arrays.asList(getDefaultWeighting())); }
@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); }
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 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); }