com.graphhopper.util.Helper.nf()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(138)

本文整理了Java中com.graphhopper.util.Helper.nf()方法的一些代码示例,展示了Helper.nf()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Helper.nf()方法的具体详情如下:
包路径:com.graphhopper.util.Helper
类名称:Helper
方法名:nf

Helper.nf介绍

暂无

代码示例

代码示例来源:origin: graphhopper/graphhopper

  1. final void checkAdjNodeBounds(int adjNode) {
  2. if (adjNode < 0 && adjNode != Integer.MIN_VALUE || adjNode >= nodeCount)
  3. throw new IllegalStateException("adjNode " + adjNode + " out of bounds [0," + nf(nodeCount) + ")");
  4. }

代码示例来源:origin: graphhopper/graphhopper

  1. @Override
  2. public String getStatisticsString() {
  3. return String.format(Locale.ROOT, "meanDegree: %.2f, dijkstras: %10s, mem: %10s",
  4. meanDegree, nf(dijkstraCount), prepareAlgo.getMemoryUsageAsString());
  5. }

代码示例来源:origin: graphhopper/graphhopper

  1. private void logStats(int updateCounter) {
  2. logger.info(String.format(Locale.ROOT,
  3. "nodes: %10s, shortcuts: %10s, updates: %2d, checked-nodes: %10s, %s, %s, %s",
  4. nf(sortedNodes.getSize()),
  5. nf(nodeContractor.getAddedShortcutsCount()),
  6. updateCounter,
  7. nf(checkCounter),
  8. getTimesAsString(),
  9. nodeContractor.getStatisticsString(),
  10. Helper.getMemInfo()));
  11. }

代码示例来源:origin: graphhopper/graphhopper

  1. String toDetailsString() {
  2. return "edges:" + nf(edgeCount) + "(" + edges.getCapacity() / Helper.MB + "MB), "
  3. + "nodes:" + nf(getNodes()) + "(" + nodes.getCapacity() / Helper.MB + "MB), "
  4. + "name:(" + nameIndex.getCapacity() / Helper.MB + "MB), "
  5. + "geo:" + nf(maxGeoRef) + "(" + wayGeometry.getCapacity() / Helper.MB + "MB), "
  6. + "bounds:" + bounds;
  7. }

代码示例来源:origin: graphhopper/graphhopper

  1. String toDetailsString() {
  2. return toString() + ", shortcuts:" + nf(shortcutCount) + ", nodesCH:(" + nodesCH.getCapacity() / Helper.MB + "MB)";
  3. }

代码示例来源:origin: graphhopper/graphhopper

  1. /**
  2. * Internal method to clean up the graph.
  3. */
  4. protected void cleanUp() {
  5. int prevNodeCount = ghStorage.getNodes();
  6. PrepareRoutingSubnetworks preparation = new PrepareRoutingSubnetworks(ghStorage, encodingManager.fetchEdgeEncoders());
  7. preparation.setMinNetworkSize(minNetworkSize);
  8. preparation.setMinOneWayNetworkSize(minOneWayNetworkSize);
  9. preparation.doWork();
  10. int currNodeCount = ghStorage.getNodes();
  11. logger.info("edges: " + Helper.nf(ghStorage.getAllEdges().length()) + ", nodes " + Helper.nf(currNodeCount)
  12. + ", there were " + Helper.nf(preparation.getMaxSubnetworks())
  13. + " subnetworks. removed them => " + Helper.nf(prevNodeCount - currNodeCount)
  14. + " less nodes");
  15. }

代码示例来源:origin: graphhopper/graphhopper

  1. @Override
  2. public void doSpecificWork() {
  3. allSW.start();
  4. initFromGraph();
  5. runGraphContraction();
  6. logger.info("took:" + (int) allSW.stop().getSeconds() + "s "
  7. + ", new shortcuts: " + nf(nodeContractor.getAddedShortcutsCount())
  8. + ", initSize:" + nf(initSize)
  9. + ", " + prepareWeighting
  10. + ", periodic:" + params.getPeriodicUpdatesPercentage()
  11. + ", lazy:" + params.getLastNodesLazyUpdatePercentage()
  12. + ", neighbor:" + params.getNeighborUpdatePercentage()
  13. + ", " + getTimesAsString()
  14. + ", lazy-overhead: " + (int) (100 * ((checkCounter / (double) initSize) - 1)) + "%"
  15. + ", " + Helper.getMemInfo());
  16. int edgeCount = prepareGraph.getOriginalEdges();
  17. logger.info("graph now - num edges: {}, num nodes: {}, num shortcuts: {}",
  18. nf(edgeCount), nf(prepareGraph.getNodes()), nf(prepareGraph.getEdges() - edgeCount));
  19. }

代码示例来源:origin: graphhopper/graphhopper

  1. @Override
  2. public LocationIndex prepareIndex() {
  3. if (initialized)
  4. throw new IllegalStateException("Call prepareIndex only once");
  5. StopWatch sw = new StopWatch().start();
  6. prepareAlgo();
  7. // in-memory preparation
  8. InMemConstructionIndex inMem = getPrepareInMemIndex();
  9. // compact & store to dataAccess
  10. dataAccess.create(64 * 1024);
  11. try {
  12. inMem.store(inMem.root, START_POINTER);
  13. flush();
  14. } catch (Exception ex) {
  15. throw new IllegalStateException("Problem while storing location index. " + Helper.getMemInfo(), ex);
  16. }
  17. float entriesPerLeaf = (float) inMem.size / inMem.leafs;
  18. initialized = true;
  19. logger.info("location index created in " + sw.stop().getSeconds()
  20. + "s, size:" + Helper.nf(inMem.size)
  21. + ", leafs:" + Helper.nf(inMem.leafs)
  22. + ", precision:" + minResolutionInMeter
  23. + ", depth:" + entries.length
  24. + ", checksum:" + calcChecksum()
  25. + ", entries:" + Arrays.toString(entries)
  26. + ", entriesPerLeaf:" + entriesPerLeaf);
  27. return this;
  28. }

代码示例来源:origin: com.graphhopper/graphhopper-core

  1. final void checkAdjNodeBounds(int adjNode) {
  2. if (adjNode < 0 && adjNode != Integer.MIN_VALUE || adjNode >= nodeCount)
  3. throw new IllegalStateException("adjNode " + adjNode + " out of bounds [0," + nf(nodeCount) + ")");
  4. }

代码示例来源:origin: com.rgi-corp/graphhopper

  1. final void checkAdjNodeBounds(int adjNode) {
  2. if (adjNode < 0 && adjNode != Integer.MIN_VALUE || adjNode >= nodeCount)
  3. throw new IllegalStateException("adjNode " + adjNode + " out of bounds [0," + nf(nodeCount) + ")");
  4. }

代码示例来源:origin: com.graphhopper/graphhopper

  1. final void checkAdjNodeBounds( int adjNode )
  2. {
  3. if (adjNode < 0 && adjNode != Integer.MIN_VALUE || adjNode >= nodeCount)
  4. throw new IllegalStateException("adjNode " + adjNode + " out of bounds [0," + nf(nodeCount) + ")");
  5. }

代码示例来源:origin: com.graphhopper/graphhopper-core

  1. @Override
  2. public String getStatisticsString() {
  3. return String.format(Locale.ROOT, "meanDegree: %.2f, dijkstras: %10s, mem: %10s",
  4. meanDegree, nf(dijkstraCount), prepareAlgo.getMemoryUsageAsString());
  5. }

代码示例来源:origin: com.graphhopper/graphhopper-core

  1. private void logStats(int updateCounter) {
  2. logger.info(String.format(Locale.ROOT,
  3. "nodes: %10s, shortcuts: %10s, updates: %2d, checked-nodes: %10s, %s, %s, %s",
  4. nf(sortedNodes.getSize()),
  5. nf(nodeContractor.getAddedShortcutsCount()),
  6. updateCounter,
  7. nf(checkCounter),
  8. getTimesAsString(),
  9. nodeContractor.getStatisticsString(),
  10. Helper.getMemInfo()));
  11. }

代码示例来源:origin: com.graphhopper/graphhopper

  1. String toDetailsString()
  2. {
  3. return "edges:" + nf(edgeCount) + "(" + edges.getCapacity() / Helper.MB + "MB), "
  4. + "nodes:" + nf(getNodes()) + "(" + nodes.getCapacity() / Helper.MB + "MB), "
  5. + "name:(" + nameIndex.getCapacity() / Helper.MB + "MB), "
  6. + "geo:" + nf(maxGeoRef) + "(" + wayGeometry.getCapacity() / Helper.MB + "MB), "
  7. + "bounds:" + bounds;
  8. }

代码示例来源:origin: com.rgi-corp/graphhopper

  1. String toDetailsString() {
  2. return "edges:" + nf(edgeCount) + "(" + edges.getCapacity() / Helper.MB + "MB), "
  3. + "nodes:" + nf(getNodes()) + "(" + nodes.getCapacity() / Helper.MB + "MB), "
  4. + "name:(" + nameIndex.getCapacity() / Helper.MB + "MB), "
  5. + "geo:" + nf(maxGeoRef) + "(" + wayGeometry.getCapacity() / Helper.MB + "MB), "
  6. + "bounds:" + bounds;
  7. }

代码示例来源:origin: com.graphhopper/graphhopper-core

  1. String toDetailsString() {
  2. return "edges:" + nf(edgeCount) + "(" + edges.getCapacity() / Helper.MB + "MB), "
  3. + "nodes:" + nf(getNodes()) + "(" + nodes.getCapacity() / Helper.MB + "MB), "
  4. + "name:(" + nameIndex.getCapacity() / Helper.MB + "MB), "
  5. + "geo:" + nf(maxGeoRef) + "(" + wayGeometry.getCapacity() / Helper.MB + "MB), "
  6. + "bounds:" + bounds;
  7. }

代码示例来源:origin: com.graphhopper/graphhopper

  1. String toDetailsString()
  2. {
  3. return toString() + ", shortcuts:" + nf(shortcutCount) + ", nodesCH:(" + nodesCH.getCapacity() / Helper.MB + "MB)";
  4. }

代码示例来源:origin: com.rgi-corp/graphhopper

  1. String toDetailsString() {
  2. return toString() + ", shortcuts:" + nf(shortcutCount) + ", nodesCH:(" + nodesCH.getCapacity() / Helper.MB + "MB)";
  3. }

代码示例来源:origin: com.graphhopper/graphhopper-core

  1. String toDetailsString() {
  2. return toString() + ", shortcuts:" + nf(shortcutCount) + ", nodesCH:(" + nodesCH.getCapacity() / Helper.MB + "MB)";
  3. }

代码示例来源:origin: com.graphhopper/graphhopper-core

  1. /**
  2. * Internal method to clean up the graph.
  3. */
  4. protected void cleanUp() {
  5. int prevNodeCount = ghStorage.getNodes();
  6. PrepareRoutingSubnetworks preparation = new PrepareRoutingSubnetworks(ghStorage, encodingManager.fetchEdgeEncoders());
  7. preparation.setMinNetworkSize(minNetworkSize);
  8. preparation.setMinOneWayNetworkSize(minOneWayNetworkSize);
  9. preparation.doWork();
  10. int currNodeCount = ghStorage.getNodes();
  11. logger.info("edges: " + Helper.nf(ghStorage.getAllEdges().length()) + ", nodes " + Helper.nf(currNodeCount)
  12. + ", there were " + Helper.nf(preparation.getMaxSubnetworks())
  13. + " subnetworks. removed them => " + Helper.nf(prevNodeCount - currNodeCount)
  14. + " less nodes");
  15. }

相关文章