@Override public void init(CmdArgs args) { setPreparationThreads(args.getInt(Parameters.Landmark.PREPARE + "threads", getPreparationThreads())); landmarkCount = args.getInt(Parameters.Landmark.COUNT, landmarkCount); activeLandmarkCount = args.getInt(Landmark.ACTIVE_COUNT_DEFAULT, Math.min(8, landmarkCount)); logDetails = args.getBool(Landmark.PREPARE + "log_details", false); minNodes = args.getInt(Landmark.PREPARE + "min_network_size", -1); for (String loc : args.get(Landmark.PREPARE + "suggestions_location", "").split(",")) { if (!loc.trim().isEmpty()) lmSuggestionsLocations.add(loc.trim()); } String lmWeightingsStr = args.get(Landmark.PREPARE + "weightings", ""); if (!lmWeightingsStr.isEmpty() && !lmWeightingsStr.equalsIgnoreCase("no")) { List<String> tmpLMWeightingList = Arrays.asList(lmWeightingsStr.split(",")); setWeightingsAsStrings(tmpLMWeightingList); } boolean enableThis = !weightingsAsStrings.isEmpty(); setEnabled(enableThis); if (enableThis) setDisablingAllowed(args.getBool(Landmark.INIT_DISABLING_ALLOWED, isDisablingAllowed())); }
public static void main(String[] strs) { CmdArgs cmdArgs = CmdArgs.read(strs); int repeats = cmdArgs.getInt("measurement.repeats", 1); for (int i = 0; i < repeats; ++i) new Measurement().start(cmdArgs); }
@Override public void init(CmdArgs args) { // throw explicit error for deprecated configs if (!args.get("prepare.threads", "").isEmpty()) throw new IllegalStateException("Use " + CH.PREPARE + "threads instead of prepare.threads"); if (!args.get("prepare.chWeighting", "").isEmpty() || !args.get("prepare.chWeightings", "").isEmpty()) throw new IllegalStateException("Use " + CH.PREPARE + "weightings and a comma separated list instead of prepare.chWeighting or prepare.chWeightings"); setPreparationThreads(args.getInt(CH.PREPARE + "threads", getPreparationThreads())); // default is enabled & fastest String chWeightingsStr = args.get(CH.PREPARE + "weightings", ""); if ("no".equals(chWeightingsStr) || "false".equals(chWeightingsStr)) { // default is fastest and we need to clear this explicitly weightingsAsStrings.clear(); } else if (!chWeightingsStr.isEmpty()) { List<String> tmpCHWeightingList = Arrays.asList(chWeightingsStr.split(",")); setWeightingsAsStrings(tmpCHWeightingList); } boolean enableThis = !weightingsAsStrings.isEmpty(); setEnabled(enableThis); if (enableThis) setDisablingAllowed(args.getBool(CH.INIT_DISABLING_ALLOWED, isDisablingAllowed())); pMap = args; }
public void start(CmdArgs cmdArgs) { String logfile = cmdArgs.get("logfile", ""); int workers = cmdArgs.getInt("workers", 1); baseUrl = cmdArgs.get("baseurl", ""); tooShortDistance = cmdArgs.getDouble("too_short_distance", 50d); maxQueries = cmdArgs.getLong("maxqueries", 1000L); timeout = cmdArgs.getInt("timeout", 3000); logRequest = cmdArgs.getBool("log_request", false); statusUpdateCnt = maxQueries / 10;
defaultSegmentSize = args.getInt("graph.dataaccess.segment_size", defaultSegmentSize); int bytesForFlags = args.getInt("graph.bytes_for_flags", 4); String flagEncodersStr = args.get("graph.flag_encoders", ""); if (!flagEncodersStr.isEmpty()) minNetworkSize = args.getInt("prepare.min_network_size", minNetworkSize); minOneWayNetworkSize = args.getInt("prepare.min_one_way_network_size", minOneWayNetworkSize); dataReaderWorkerThreads = args.getInt("datareader.worker_threads", dataReaderWorkerThreads); enableInstructions = args.getBool("datareader.instructions", enableInstructions); preferredLanguage = args.get("datareader.preferred_language", preferredLanguage); preciseIndexResolution = args.getInt("index.high_resolution", preciseIndexResolution); maxRegionSearch = args.getInt("index.max_region_search", maxRegionSearch); maxVisitedNodes = args.getInt(Routing.INIT_MAX_VISITED_NODES, Integer.MAX_VALUE); maxRoundTripRetries = args.getInt(RoundTrip.INIT_MAX_RETRIES, maxRoundTripRetries); nonChMaxWaypointDistance = args.getInt(Parameters.NON_CH.MAX_NON_CH_POINT_DISTANCE, Integer.MAX_VALUE);
int count = args.getInt("measurement.count", 5000);
@Override public void init(CmdArgs args) { setPreparationThreads(args.getInt(Parameters.Landmark.PREPARE + "threads", getPreparationThreads())); landmarkCount = args.getInt(Parameters.Landmark.COUNT, landmarkCount); activeLandmarkCount = args.getInt(Landmark.ACTIVE_COUNT_DEFAULT, Math.min(8, landmarkCount)); for (String loc : args.get("prepare.lm.suggestions_location", "").split(",")) { if (!loc.trim().isEmpty()) lmSuggestionsLocations.add(loc.trim()); } String lmWeightingsStr = args.get(Landmark.PREPARE + "weightings", ""); if (!lmWeightingsStr.isEmpty()) { List<String> tmpLMWeightingList = Arrays.asList(lmWeightingsStr.split(",")); setWeightingsAsStrings(tmpLMWeightingList); } boolean enableThis = !weightingsAsStrings.isEmpty(); setEnabled(enableThis); if (enableThis) setDisablingAllowed(args.getBool(Landmark.INIT_DISABLING_ALLOWED, isDisablingAllowed())); }
@Override public void init(CmdArgs args) { setPreparationThreads(args.getInt(Parameters.Landmark.PREPARE + "threads", getPreparationThreads())); landmarkCount = args.getInt(Parameters.Landmark.COUNT, landmarkCount); activeLandmarkCount = args.getInt(Landmark.ACTIVE_COUNT_DEFAULT, Math.min(8, landmarkCount)); logDetails = args.getBool(Landmark.PREPARE + "log_details", false); minNodes = args.getInt(Landmark.PREPARE + "min_network_size", -1); for (String loc : args.get(Landmark.PREPARE + "suggestions_location", "").split(",")) { if (!loc.trim().isEmpty()) lmSuggestionsLocations.add(loc.trim()); } String lmWeightingsStr = args.get(Landmark.PREPARE + "weightings", ""); if (!lmWeightingsStr.isEmpty() && !lmWeightingsStr.equalsIgnoreCase("no")) { List<String> tmpLMWeightingList = Arrays.asList(lmWeightingsStr.split(",")); setWeightingsAsStrings(tmpLMWeightingList); } boolean enableThis = !weightingsAsStrings.isEmpty(); setEnabled(enableThis); if (enableThis) setDisablingAllowed(args.getBool(Landmark.INIT_DISABLING_ALLOWED, isDisablingAllowed())); }
@Override public void init(CmdArgs args) { // throw explicit error for deprecated configs if (!args.get("prepare.threads", "").isEmpty()) throw new IllegalStateException("Use " + CH.PREPARE + "threads instead of prepare.threads"); if (!args.get("prepare.chWeighting", "").isEmpty() || !args.get("prepare.chWeightings", "").isEmpty()) throw new IllegalStateException("Use " + CH.PREPARE + "weightings and a comma separated list instead of prepare.chWeighting or prepare.chWeightings"); setPreparationThreads(args.getInt(CH.PREPARE + "threads", getPreparationThreads())); // default is enabled & fastest String chWeightingsStr = args.get(CH.PREPARE + "weightings", ""); if ("no".equals(chWeightingsStr) || "false".equals(chWeightingsStr)) { // default is fastest and we need to clear this explicitly weightingsAsStrings.clear(); } else if (!chWeightingsStr.isEmpty()) { List<String> tmpCHWeightingList = Arrays.asList(chWeightingsStr.split(",")); setWeightingsAsStrings(tmpCHWeightingList); } boolean enableThis = !weightingsAsStrings.isEmpty(); setEnabled(enableThis); if (enableThis) setDisablingAllowed(args.getBool(CH.INIT_DISABLING_ALLOWED, isDisablingAllowed())); pMap = args; }
public void init( CmdArgs args ) { setPreparationThreads(args.getInt("prepare.threads", getPreparationThreads())); String deprecatedWeightingConfig = args.get("prepare.chWeighting", ""); if (!deprecatedWeightingConfig.isEmpty()) throw new IllegalStateException("Use prepare.ch.weightings and a comma separated list instead of prepare.chWeighting"); // default is enabled & fastest String chWeightingsStr = args.get("prepare.ch.weightings", ""); // backward compatibility if (chWeightingsStr.isEmpty()) chWeightingsStr = args.get("prepare.chWeightings", ""); if ("no".equals(chWeightingsStr)) { // default is fastest and we need to clear this explicitely weightingsAsStrings.clear(); } else if (!chWeightingsStr.isEmpty()) { List<String> tmpCHWeightingList = Arrays.asList(chWeightingsStr.split(",")); setWeightingsAsStrings(tmpCHWeightingList); } boolean enableThis = !weightingsAsStrings.isEmpty(); setEnabled(enableThis); if (enableThis) setDisablingAllowed(args.getBool(CH.INIT_DISABLING_ALLOWED, isDisablingAllowed())); setPreparationPeriodicUpdates(args.getInt("prepare.updates.periodic", getPreparationPeriodicUpdates())); setPreparationLazyUpdates(args.getInt("prepare.updates.lazy", getPreparationLazyUpdates())); setPreparationNeighborUpdates(args.getInt("prepare.updates.neighbor", getPreparationNeighborUpdates())); setPreparationContractedNodes(args.getInt("prepare.contracted_nodes", getPreparationContractedNodes())); setPreparationLogMessages(args.getDouble("prepare.log_messages", getPreparationLogMessages())); }
@Override public void init(CmdArgs args) { // throw explicit error for deprecated configs if (!args.get("prepare.threads", "").isEmpty()) throw new IllegalStateException("Use " + CH.PREPARE + "threads instead of prepare.threads"); if (!args.get("prepare.chWeighting", "").isEmpty() || !args.get("prepare.chWeightings", "").isEmpty()) throw new IllegalStateException("Use " + CH.PREPARE + "weightings and a comma separated list instead of prepare.chWeighting or prepare.chWeightings"); setPreparationThreads(args.getInt(CH.PREPARE + "threads", getPreparationThreads())); // default is enabled & fastest String chWeightingsStr = args.get(CH.PREPARE + "weightings", ""); if ("no".equals(chWeightingsStr)) { // default is fastest and we need to clear this explicitely weightingsAsStrings.clear(); } else if (!chWeightingsStr.isEmpty()) { List<String> tmpCHWeightingList = Arrays.asList(chWeightingsStr.split(",")); setWeightingsAsStrings(tmpCHWeightingList); } boolean enableThis = !weightingsAsStrings.isEmpty(); setEnabled(enableThis); if (enableThis) setDisablingAllowed(args.getBool(CH.INIT_DISABLING_ALLOWED, isDisablingAllowed())); setPreparationPeriodicUpdates(args.getInt(CH.PREPARE + "updates.periodic", getPreparationPeriodicUpdates())); setPreparationLazyUpdates(args.getInt(CH.PREPARE + "updates.lazy", getPreparationLazyUpdates())); setPreparationNeighborUpdates(args.getInt(CH.PREPARE + "updates.neighbor", getPreparationNeighborUpdates())); setPreparationContractedNodes(args.getInt(CH.PREPARE + "contracted_nodes", getPreparationContractedNodes())); setPreparationLogMessages(args.getDouble(CH.PREPARE + "log_messages", getPreparationLogMessages())); }
defaultSegmentSize = args.getInt("graph.dataaccess.segment_size", defaultSegmentSize); int bytesForFlags = args.getInt("graph.bytes_for_flags", 4); String flagEncodersStr = args.get("graph.flag_encoders", ""); if (!flagEncodersStr.isEmpty()) minNetworkSize = args.getInt("prepare.min_network_size", minNetworkSize); minOneWayNetworkSize = args.getInt("prepare.min_one_way_network_size", minOneWayNetworkSize); dataReaderWorkerThreads = args.getInt("datareader.worker_threads", dataReaderWorkerThreads); enableInstructions = args.getBool("datareader.instructions", enableInstructions); preferredLanguage = args.get("datareader.preferred_language", preferredLanguage); preciseIndexResolution = args.getInt("index.high_resolution", preciseIndexResolution); maxRegionSearch = args.getInt("index.max_region_search", maxRegionSearch); maxVisitedNodes = args.getInt(Routing.INIT_MAX_VISITED_NODES, Integer.MAX_VALUE); maxRoundTripRetries = args.getInt(RoundTrip.INIT_MAX_RETRIES, maxRoundTripRetries); nonChMaxWaypointDistance = args.getInt(Parameters.NON_CH.MAX_NON_CH_POINT_DISTANCE, Integer.MAX_VALUE); blockedRectangularAreas = args.get(Routing.BLOCK_AREA, "");
defaultSegmentSize = args.getInt("graph.dataaccess.segment_size", defaultSegmentSize); int bytesForFlags = args.getInt("graph.bytes_for_flags", 4); String flagEncodersStr = args.get("graph.flag_encoders", ""); if (!flagEncodersStr.isEmpty()) minNetworkSize = args.getInt("prepare.min_network_size", minNetworkSize); minOneWayNetworkSize = args.getInt("prepare.min_one_way_network_size", minOneWayNetworkSize); workerThreads = args.getInt("osmreader.worker_threads", workerThreads); enableInstructions = args.getBool("osmreader.instructions", enableInstructions); preferredLanguage = args.get("osmreader.preferred_language", preferredLanguage); preciseIndexResolution = args.getInt("index.high_resolution", preciseIndexResolution); maxRegionSearch = args.getInt("index.max_region_search", maxRegionSearch); maxVisitedNodes = args.getInt(Routing.INIT_MAX_VISITED_NODES, Integer.MAX_VALUE); maxRoundTripRetries = args.getInt(RoundTrip.INIT_MAX_RETRIES, maxRoundTripRetries);
defaultSegmentSize = args.getInt("graph.dataaccess.segment_size", defaultSegmentSize); int bytesForFlags = args.getInt("graph.bytes_for_flags", 4); String flagEncodersStr = args.get("graph.flag_encoders", ""); if (!flagEncodersStr.isEmpty()) minNetworkSize = args.getInt("prepare.min_network_size", minNetworkSize); minOneWayNetworkSize = args.getInt("prepare.min_one_way_network_size", minOneWayNetworkSize); dataReaderWorkerThreads = args.getInt("datareader.worker_threads", dataReaderWorkerThreads); enableInstructions = args.getBool("datareader.instructions", enableInstructions); preferredLanguage = args.get("datareader.preferred_language", preferredLanguage); preciseIndexResolution = args.getInt("index.high_resolution", preciseIndexResolution); maxRegionSearch = args.getInt("index.max_region_search", maxRegionSearch); maxVisitedNodes = args.getInt(Routing.INIT_MAX_VISITED_NODES, Integer.MAX_VALUE); maxRoundTripRetries = args.getInt(RoundTrip.INIT_MAX_RETRIES, maxRoundTripRetries); nonChMaxWaypointDistance = args.getInt(Parameters.NON_CH.MAX_NON_CH_POINT_DISTANCE, Integer.MAX_VALUE);
GraphHopperStorage graph = hopper.getGraphHopperStorage(); int gpxAccuracy = args.getInt("gpx_accuracy", 15); String instructions = args.get("instructions", ""); logger.info("Setup lookup index. Accuracy filter is at " + gpxAccuracy + "m"); (LocationIndexTree) hopper.getLocationIndex(), gpxAccuracy); MapMatching mapMatching = new MapMatching(graph, locationIndex, firstEncoder); mapMatching.setSeparatedSearchDistance(args.getInt("separated_search_distance", 500)); mapMatching.setMaxVisitedNodes(args.getInt("max_visited_nodes", 1000)); mapMatching.setForceRepair(args.getBool("force_repair", false));