public LMAlgoFactoryDecorator addPreparation(PrepareLandmarks pch) { preparations.add(pch); int lastIndex = preparations.size() - 1; if (lastIndex >= weightings.size()) throw new IllegalStateException("Cannot access weighting for PrepareLandmarks with " + pch.getWeighting() + ". Call add(Weighting) before"); if (preparations.get(lastIndex).getWeighting() != weightings.get(lastIndex)) throw new IllegalArgumentException("Weighting of PrepareContractionHierarchies " + preparations.get(lastIndex).getWeighting() + " needs to be identical to previously added " + weightings.get(lastIndex)); return this; }
@Override public void run() { if (plm.loadExisting()) return; LOGGER.info(tmpCounter + "/" + getPreparations().size() + " calling LM prepare.doWork for " + plm.getWeighting() + " ... (" + getMemInfo() + ")"); prepared.set(true); Thread.currentThread().setName(name); plm.doWork(); properties.put(Landmark.PREPARE + "date." + name, createFormatter().format(new Date())); } }, name);
counter++; final int tmpCounter = counter; final String name = AbstractWeighting.weightingToFileName(plm.getWeighting()); completionService.submit(new Runnable() { @Override
@Override public RoutingAlgorithmFactory getDecoratedAlgorithmFactory(RoutingAlgorithmFactory defaultAlgoFactory, HintsMap map) { // for now do not allow mixing CH&LM #1082 boolean disableCH = map.getBool(Parameters.CH.DISABLE, false); boolean disableLM = map.getBool(Parameters.Landmark.DISABLE, false); if (!isEnabled() || disablingAllowed && disableLM || !disableCH) return defaultAlgoFactory; if (preparations.isEmpty()) throw new IllegalStateException("No preparations added to this decorator"); for (final PrepareLandmarks p : preparations) { if (p.getWeighting().matches(map)) return new LMRAFactory(p, defaultAlgoFactory); } // if the initial encoder&weighting has certain properties we could cross query it but for now avoid this return defaultAlgoFactory; }
public LMAlgoFactoryDecorator addPreparation(PrepareLandmarks pch) { preparations.add(pch); int lastIndex = preparations.size() - 1; if (lastIndex >= weightings.size()) throw new IllegalStateException("Cannot access weighting for PrepareLandmarks with " + pch.getWeighting() + ". Call add(Weighting) before"); if (preparations.get(lastIndex).getWeighting() != weightings.get(lastIndex)) throw new IllegalArgumentException("Weighting of PrepareContractionHierarchies " + preparations.get(lastIndex).getWeighting() + " needs to be identical to previously added " + weightings.get(lastIndex)); return this; }
public LMAlgoFactoryDecorator addPreparation(PrepareLandmarks pch) { preparations.add(pch); int lastIndex = preparations.size() - 1; if (lastIndex >= weightings.size()) throw new IllegalStateException("Cannot access weighting for PrepareLandmarks with " + pch.getWeighting() + ". Call add(Weighting) before"); if (preparations.get(lastIndex).getWeighting() != weightings.get(lastIndex)) throw new IllegalArgumentException("Weighting of PrepareContractionHierarchies " + preparations.get(lastIndex).getWeighting() + " needs to be identical to previously added " + weightings.get(lastIndex)); return this; }
@Override public void run() { if (plm.loadExisting()) return; LOGGER.info(tmpCounter + "/" + getPreparations().size() + " calling LM prepare.doWork for " + plm.getWeighting() + " ... (" + getMemInfo() + ")"); prepared.set(true); Thread.currentThread().setName(name); plm.doWork(); properties.put(Landmark.PREPARE + "date." + name, createFormatter().format(new Date())); } }, name);
@Override public RoutingAlgorithmFactory getDecoratedAlgorithmFactory(RoutingAlgorithmFactory defaultAlgoFactory, HintsMap map) { boolean forceFlexMode = map.getBool(DISABLE, false); if (!isEnabled() || disablingAllowed && forceFlexMode) return defaultAlgoFactory; if (preparations.isEmpty()) throw new IllegalStateException("No preparations added to this decorator"); for (final PrepareLandmarks p : preparations) { if (p.getWeighting().matches(map)) return new LMRAFactory(p, defaultAlgoFactory); } // if the initial encoder&weighting has certain properies we could cross query it but for now avoid this return defaultAlgoFactory; }
counter++; final int tmpCounter = counter; final String name = AbstractWeighting.weightingToFileName(plm.getWeighting()); completionService.submit(new Runnable() { @Override
LOGGER.info(counter + "/" + getPreparations().size() + " calling LM prepare.doWork for " + plm.getWeighting() + " ... (" + Helper.getMemInfo() + ")"); final String name = AbstractWeighting.weightingToFileName(plm.getWeighting()); threadPool.execute(new Runnable() { @Override
@Override public RoutingAlgorithmFactory getDecoratedAlgorithmFactory(RoutingAlgorithmFactory defaultAlgoFactory, HintsMap map) { // for now do not allow mixing CH&LM #1082 boolean disableCH = map.getBool(Parameters.CH.DISABLE, false); boolean disableLM = map.getBool(Parameters.Landmark.DISABLE, false); if (!isEnabled() || disablingAllowed && disableLM || !disableCH) return defaultAlgoFactory; if (preparations.isEmpty()) throw new IllegalStateException("No preparations added to this decorator"); for (final PrepareLandmarks p : preparations) { if (p.getWeighting().matches(map)) return new LMRAFactory(p, defaultAlgoFactory); } // if the initial encoder&weighting has certain properties we could cross query it but for now avoid this return defaultAlgoFactory; }