@Override public boolean loadExisting() { if (isInitialized()) throw new IllegalStateException("Cannot call PrepareLandmarks.loadExisting if already initialized"); if (landmarkWeightDA.loadExisting()) {
public RoutingAlgorithm getDecoratedAlgorithm(Graph qGraph, RoutingAlgorithm algo, AlgorithmOptions opts) { int activeLM = Math.max(1, opts.getHints().getInt(Landmark.ACTIVE_COUNT, defaultActiveLandmarks)); if (algo instanceof AStar) { if (!lms.isInitialized()) throw new IllegalStateException("Initialize landmark storage before creating algorithms"); return algo; } else if (algo instanceof AStarBidirection) { if (!lms.isInitialized()) throw new IllegalStateException("Initialize landmark storage before creating algorithms"); return algo; } else if (algo instanceof AlternativeRoute) { if (!lms.isInitialized()) throw new IllegalStateException("Initialize landmark storage before creating algorithms");
@Override public boolean loadExisting() { if (isInitialized()) throw new IllegalStateException("Cannot call PrepareLandmarks.loadExisting if already initialized"); if (landmarkWeightDA.loadExisting()) { if (!subnetworkStorage.loadExisting()) throw new IllegalStateException("landmark weights loaded but not the subnetworks!?"); int nodes = landmarkWeightDA.getHeader(0 * 4); if (nodes != graph.getNodes()) throw new IllegalArgumentException("Cannot load landmark data as written for different graph storage with " + nodes + " nodes, not " + graph.getNodes()); landmarks = landmarkWeightDA.getHeader(1 * 4); int subnetworks = landmarkWeightDA.getHeader(2 * 4); factor = landmarkWeightDA.getHeader(3 * 4) / DOUBLE_MLTPL; LM_ROW_LENGTH = landmarks * 4; long maxBytes = LM_ROW_LENGTH * nodes; long bytePos = maxBytes; // in the first subnetwork 0 there are no landmark IDs stored for (int j = 0; j < subnetworks; j++) { int[] tmpLandmarks = new int[landmarks]; for (int i = 0; i < tmpLandmarks.length; i++) { tmpLandmarks[i] = landmarkWeightDA.getInt(bytePos); bytePos += 4; } landmarkIDs.add(tmpLandmarks); } initialized = true; return true; } return false; }
@Override public boolean loadExisting() { if (isInitialized()) throw new IllegalStateException("Cannot call PrepareLandmarks.loadExisting if already initialized"); if (landmarkWeightDA.loadExisting()) {
public RoutingAlgorithm getDecoratedAlgorithm(Graph qGraph, RoutingAlgorithm algo, AlgorithmOptions opts) { int activeLM = Math.max(1, opts.getHints().getInt(Landmark.ACTIVE_COUNT, defaultActiveLandmarks)); if (algo instanceof AStar) { if (!lms.isInitialized()) throw new IllegalStateException("Initialize landmark storage before creating algorithms"); return algo; } else if (algo instanceof AStarBidirection) { if (!lms.isInitialized()) throw new IllegalStateException("Initialize landmark storage before creating algorithms"); return algo; } else if (algo instanceof AlternativeRoute) { if (!lms.isInitialized()) throw new IllegalStateException("Initialize landmark storage before creating algorithms");
public RoutingAlgorithm getDecoratedAlgorithm(Graph qGraph, RoutingAlgorithm algo, AlgorithmOptions opts) { int activeLM = Math.max(1, opts.getHints().getInt(Landmark.ACTIVE_COUNT, defaultActiveLandmarks)); if (algo instanceof AStar) { if (!lms.isInitialized()) throw new IllegalStateException("Initalize landmark storage before creating algorithms"); return algo; } else if (algo instanceof AStarBidirection) { if (!lms.isInitialized()) throw new IllegalStateException("Initalize landmark storage before creating algorithms"); return algo; } else if (algo instanceof AlternativeRoute) { if (!lms.isInitialized()) throw new IllegalStateException("Initalize landmark storage before creating algorithms");