/** * @see LandmarkStorage#setMaximumWeight(double) */ public PrepareLandmarks setMaximumWeight(double maximumWeight) { lms.setMaximumWeight(maximumWeight); return this; }
/** * @see LandmarkStorage#setSpatialRuleLookup(SpatialRuleLookup) */ public PrepareLandmarks setSpatialRuleLookup(SpatialRuleLookup ruleLookup) { lms.setSpatialRuleLookup(ruleLookup); return this; }
@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 final boolean isDisablingAllowed() { return disablingAllowed || !isEnabled(); }
public int getSubnetworksWithLandmarks() { return lms.getSubnetworksWithLandmarks(); }
/** * @see LandmarkStorage#setMinimumNodes(int) */ public void setMinimumNodes(int nodes) { if (nodes < 2) throw new IllegalArgumentException("minimum node count must be at least 2"); lms.setMinimumNodes(nodes); }
public PrepareLandmarks(Directory dir, GraphHopperStorage graph, Weighting weighting, int landmarks, int activeLandmarks) { if (activeLandmarks > landmarks) throw new IllegalArgumentException("Default value for active landmarks " + activeLandmarks + " should be less or equal to landmark count of " + landmarks); this.graph = graph; this.defaultActiveLandmarks = activeLandmarks; this.weighting = weighting; lms = new LandmarkStorage(graph, dir, weighting, landmarks); }
@Override public RoutingAlgorithm createAlgo(Graph g, AlgorithmOptions opts) { RoutingAlgorithm algo = defaultAlgoFactory.createAlgo(g, opts); return p.getDecoratedAlgorithm(g, algo, opts); } }
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); }
/** * @see LandmarkStorage#setLandmarkSuggestions(List) */ public PrepareLandmarks setLandmarkSuggestions(List<LandmarkSuggestion> landmarkSuggestions) { lms.setLandmarkSuggestions(landmarkSuggestions); return this; }
public LandmarkExplorer(Graph g, LandmarkStorage lms, Weighting weighting, TraversalMode tMode, boolean from) { super(g, weighting, tMode); this.lms = lms; this.from = from; // set one of the bi directions as already finished if (from) finishedTo = true; else finishedFrom = true; // no path should be calculated setUpdateBestPath(false); }
/** * @see LandmarkStorage#setLMSelectionWeighting(Weighting) */ public void setLMSelectionWeighting(Weighting w) { lms.setLMSelectionWeighting(w); }
@Override public void setTo(int to) { this.to = getNode(to); }
@Override public WeightApproximator reverse() { return new LMApproximator(graph, maxBaseNodes, lms, activeLandmarks.length, factor, !reverse); }
public boolean loadExisting() { return lms.loadExisting(); }
public LMAlgoFactoryDecorator() { setPreparationThreads(1); }
void setFilter(IntHashSet set, boolean fwd, boolean bwd) { EdgeFilter ef = new BlockedEdgesFilter(flagEncoder, fwd, bwd, set); outEdgeExplorer = graph.createEdgeExplorer(ef); inEdgeExplorer = graph.createEdgeExplorer(ef); }
public PrepareLandmarks setLogDetails(boolean logDetails) { lms.setLogDetails(logDetails); return this; }
@Override public SpatialRule lookupRule(GHPoint point) { return lookupRule(point.lat, point.lon); }