public PrepareContractionHierarchies setParams(PMap pMap) { this.pMap = pMap; params.setPeriodicUpdatesPercentage(pMap.getInt(PERIODIC_UPDATES, params.getPeriodicUpdatesPercentage())); params.setLastNodesLazyUpdatePercentage(pMap.getInt(LAST_LAZY_NODES_UPDATES, params.getLastNodesLazyUpdatePercentage())); params.setNeighborUpdatePercentage(pMap.getInt(NEIGHBOR_UPDATES, params.getNeighborUpdatePercentage())); params.setNodesContractedPercentage(pMap.getInt(CONTRACTED_NODES, params.getNodesContractedPercentage())); params.setLogMessagesPercentage(pMap.getInt(LOG_MESSAGES, params.getLogMessagesPercentage())); return this; }
static List<FlagEncoder> parseEncoderString(FlagEncoderFactory factory, String encoderList) { if (encoderList.contains(":")) throw new IllegalArgumentException("EncodingManager does no longer use reflection instantiate encoders directly."); if (!encoderList.equals(toLowerCase(encoderList))) throw new IllegalArgumentException("Since 0.7 EncodingManager does no longer accept upper case profiles: " + encoderList); String[] entries = encoderList.split(","); List<FlagEncoder> resultEncoders = new ArrayList<>(); for (String entry : entries) { entry = toLowerCase(entry.trim()); if (entry.isEmpty()) continue; String entryVal = ""; if (entry.contains("|")) { entryVal = entry; entry = entry.split("\\|")[0]; } PMap configuration = new PMap(entryVal); FlagEncoder fe = factory.createFlagEncoder(entry, configuration); if (configuration.has("version") && fe.getVersion() != configuration.getInt("version", -1)) throw new IllegalArgumentException("Encoder " + entry + " was used in version " + configuration.getLong("version", -1) + ", but current version is " + fe.getVersion()); resultEncoders.add(fe); } return resultEncoders; }
altRouteAlgo.setMaxPaths(opts.getHints().getInt(MAX_PATHS, 2)); altRouteAlgo.setMaxWeightFactor(opts.getHints().getDouble(MAX_WEIGHT, 1.4)); altRouteAlgo.setMaxShareFactor(opts.getHints().getDouble(MAX_SHARE, 0.6));
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())
public PrepareContractionHierarchies setParams(PMap pMap) { this.pMap = pMap; params.setPeriodicUpdatesPercentage(pMap.getInt(PERIODIC_UPDATES, params.getPeriodicUpdatesPercentage())); params.setLastNodesLazyUpdatePercentage(pMap.getInt(LAST_LAZY_NODES_UPDATES, params.getLastNodesLazyUpdatePercentage())); params.setNeighborUpdatePercentage(pMap.getInt(NEIGHBOR_UPDATES, params.getNeighborUpdatePercentage())); params.setNodesContractedPercentage(pMap.getInt(CONTRACTED_NODES, params.getNodesContractedPercentage())); params.setLogMessagesPercentage(pMap.getInt(LOG_MESSAGES, params.getLogMessagesPercentage())); return this; }
static List<FlagEncoder> parseEncoderString(FlagEncoderFactory factory, String encoderList) { if (encoderList.contains(":")) throw new IllegalArgumentException("EncodingManager does no longer use reflection instantiate encoders directly."); if (!encoderList.equals(encoderList.toLowerCase())) throw new IllegalArgumentException("Since 0.7 EncodingManager does no longer accept upper case profiles: " + encoderList); String[] entries = encoderList.split(","); List<FlagEncoder> resultEncoders = new ArrayList<FlagEncoder>(); for (String entry : entries) { entry = entry.trim().toLowerCase(); if (entry.isEmpty()) continue; String entryVal = ""; if (entry.contains("|")) { entryVal = entry; entry = entry.split("\\|")[0]; } PMap configuration = new PMap(entryVal); FlagEncoder fe = factory.createFlagEncoder(entry, configuration); if (configuration.has("version") && fe.getVersion() != configuration.getInt("version", -1)) throw new IllegalArgumentException("Encoder " + entry + " was used in version " + configuration.getLong("version", -1) + ", but current version is " + fe.getVersion()); resultEncoders.add(fe); } return resultEncoders; }
if (fe.getVersion() != configuration.getInt("version", -1))
static List<FlagEncoder> parseEncoderString(FlagEncoderFactory factory, String encoderList) { if (encoderList.contains(":")) throw new IllegalArgumentException("EncodingManager does no longer use reflection instantiate encoders directly."); if (!encoderList.equals(toLowerCase(encoderList))) throw new IllegalArgumentException("Since 0.7 EncodingManager does no longer accept upper case profiles: " + encoderList); String[] entries = encoderList.split(","); List<FlagEncoder> resultEncoders = new ArrayList<>(); for (String entry : entries) { entry = toLowerCase(entry.trim()); if (entry.isEmpty()) continue; String entryVal = ""; if (entry.contains("|")) { entryVal = entry; entry = entry.split("\\|")[0]; } PMap configuration = new PMap(entryVal); FlagEncoder fe = factory.createFlagEncoder(entry, configuration); if (configuration.has("version") && fe.getVersion() != configuration.getInt("version", -1)) throw new IllegalArgumentException("Encoder " + entry + " was used in version " + configuration.getLong("version", -1) + ", but current version is " + fe.getVersion()); resultEncoders.add(fe); } return resultEncoders; }
if (propertiesMap.has("version") && encoder.getVersion()!=propertiesMap.getInt("version", -1)){ properties.close(); throw new RuntimeException("Graph was built with wrong encoder version - probably built using an older version of the graphhopper library?");
public DataFlagEncoder(PMap properties) { this((int) properties.getLong("speed_bits", 5), properties.getDouble("speed_factor", 5), properties.getBool("turn_costs", false) ? 1 : 0); this.properties = properties; this.setStoreHeight(properties.getBool("store_height", false)); this.setStoreWeight(properties.getBool("store_weight", false)); this.setStoreWidth(properties.getBool("store_width", false)); this.setSpatialRules(properties.getInt("spatial_rules", 0)); }
altRouteAlgo.setMaxPaths(opts.getHints().getInt(MAX_PATHS, 2)); altRouteAlgo.setMaxWeightFactor(opts.getHints().getDouble(MAX_WEIGHT, 1.4)); altRouteAlgo.setMaxShareFactor(opts.getHints().getDouble(MAX_SHARE, 0.6));
altRouteAlgo.setMaxPaths(opts.getHints().getInt(MAX_PATHS, 2)); altRouteAlgo.setMaxWeightFactor(opts.getHints().getDouble(MAX_WEIGHT, 1.4)); altRouteAlgo.setMaxShareFactor(opts.getHints().getDouble(MAX_SHARE, 0.6));
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())
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())
altRouteAlgo.setMaxPaths(opts.getHints().getInt(MAX_PATHS, 2)); altRouteAlgo.setMaxWeightFactor(opts.getHints().getDouble(MAX_WEIGHT, 1.4)); altRouteAlgo.setMaxShareFactor(opts.getHints().getDouble(MAX_SHARE, 0.6));