本文整理了Java中com.graphhopper.util.Helper.nf()
方法的一些代码示例,展示了Helper.nf()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Helper.nf()
方法的具体详情如下:
包路径:com.graphhopper.util.Helper
类名称:Helper
方法名:nf
暂无
代码示例来源:origin: graphhopper/graphhopper
final void checkAdjNodeBounds(int adjNode) {
if (adjNode < 0 && adjNode != Integer.MIN_VALUE || adjNode >= nodeCount)
throw new IllegalStateException("adjNode " + adjNode + " out of bounds [0," + nf(nodeCount) + ")");
}
代码示例来源:origin: graphhopper/graphhopper
@Override
public String getStatisticsString() {
return String.format(Locale.ROOT, "meanDegree: %.2f, dijkstras: %10s, mem: %10s",
meanDegree, nf(dijkstraCount), prepareAlgo.getMemoryUsageAsString());
}
代码示例来源:origin: graphhopper/graphhopper
private void logStats(int updateCounter) {
logger.info(String.format(Locale.ROOT,
"nodes: %10s, shortcuts: %10s, updates: %2d, checked-nodes: %10s, %s, %s, %s",
nf(sortedNodes.getSize()),
nf(nodeContractor.getAddedShortcutsCount()),
updateCounter,
nf(checkCounter),
getTimesAsString(),
nodeContractor.getStatisticsString(),
Helper.getMemInfo()));
}
代码示例来源:origin: graphhopper/graphhopper
String toDetailsString() {
return "edges:" + nf(edgeCount) + "(" + edges.getCapacity() / Helper.MB + "MB), "
+ "nodes:" + nf(getNodes()) + "(" + nodes.getCapacity() / Helper.MB + "MB), "
+ "name:(" + nameIndex.getCapacity() / Helper.MB + "MB), "
+ "geo:" + nf(maxGeoRef) + "(" + wayGeometry.getCapacity() / Helper.MB + "MB), "
+ "bounds:" + bounds;
}
代码示例来源:origin: graphhopper/graphhopper
String toDetailsString() {
return toString() + ", shortcuts:" + nf(shortcutCount) + ", nodesCH:(" + nodesCH.getCapacity() / Helper.MB + "MB)";
}
代码示例来源:origin: graphhopper/graphhopper
/**
* Internal method to clean up the graph.
*/
protected void cleanUp() {
int prevNodeCount = ghStorage.getNodes();
PrepareRoutingSubnetworks preparation = new PrepareRoutingSubnetworks(ghStorage, encodingManager.fetchEdgeEncoders());
preparation.setMinNetworkSize(minNetworkSize);
preparation.setMinOneWayNetworkSize(minOneWayNetworkSize);
preparation.doWork();
int currNodeCount = ghStorage.getNodes();
logger.info("edges: " + Helper.nf(ghStorage.getAllEdges().length()) + ", nodes " + Helper.nf(currNodeCount)
+ ", there were " + Helper.nf(preparation.getMaxSubnetworks())
+ " subnetworks. removed them => " + Helper.nf(prevNodeCount - currNodeCount)
+ " less nodes");
}
代码示例来源:origin: graphhopper/graphhopper
@Override
public void doSpecificWork() {
allSW.start();
initFromGraph();
runGraphContraction();
logger.info("took:" + (int) allSW.stop().getSeconds() + "s "
+ ", new shortcuts: " + nf(nodeContractor.getAddedShortcutsCount())
+ ", initSize:" + nf(initSize)
+ ", " + prepareWeighting
+ ", periodic:" + params.getPeriodicUpdatesPercentage()
+ ", lazy:" + params.getLastNodesLazyUpdatePercentage()
+ ", neighbor:" + params.getNeighborUpdatePercentage()
+ ", " + getTimesAsString()
+ ", lazy-overhead: " + (int) (100 * ((checkCounter / (double) initSize) - 1)) + "%"
+ ", " + Helper.getMemInfo());
int edgeCount = prepareGraph.getOriginalEdges();
logger.info("graph now - num edges: {}, num nodes: {}, num shortcuts: {}",
nf(edgeCount), nf(prepareGraph.getNodes()), nf(prepareGraph.getEdges() - edgeCount));
}
代码示例来源:origin: graphhopper/graphhopper
@Override
public LocationIndex prepareIndex() {
if (initialized)
throw new IllegalStateException("Call prepareIndex only once");
StopWatch sw = new StopWatch().start();
prepareAlgo();
// in-memory preparation
InMemConstructionIndex inMem = getPrepareInMemIndex();
// compact & store to dataAccess
dataAccess.create(64 * 1024);
try {
inMem.store(inMem.root, START_POINTER);
flush();
} catch (Exception ex) {
throw new IllegalStateException("Problem while storing location index. " + Helper.getMemInfo(), ex);
}
float entriesPerLeaf = (float) inMem.size / inMem.leafs;
initialized = true;
logger.info("location index created in " + sw.stop().getSeconds()
+ "s, size:" + Helper.nf(inMem.size)
+ ", leafs:" + Helper.nf(inMem.leafs)
+ ", precision:" + minResolutionInMeter
+ ", depth:" + entries.length
+ ", checksum:" + calcChecksum()
+ ", entries:" + Arrays.toString(entries)
+ ", entriesPerLeaf:" + entriesPerLeaf);
return this;
}
代码示例来源:origin: com.graphhopper/graphhopper-core
final void checkAdjNodeBounds(int adjNode) {
if (adjNode < 0 && adjNode != Integer.MIN_VALUE || adjNode >= nodeCount)
throw new IllegalStateException("adjNode " + adjNode + " out of bounds [0," + nf(nodeCount) + ")");
}
代码示例来源:origin: com.rgi-corp/graphhopper
final void checkAdjNodeBounds(int adjNode) {
if (adjNode < 0 && adjNode != Integer.MIN_VALUE || adjNode >= nodeCount)
throw new IllegalStateException("adjNode " + adjNode + " out of bounds [0," + nf(nodeCount) + ")");
}
代码示例来源:origin: com.graphhopper/graphhopper
final void checkAdjNodeBounds( int adjNode )
{
if (adjNode < 0 && adjNode != Integer.MIN_VALUE || adjNode >= nodeCount)
throw new IllegalStateException("adjNode " + adjNode + " out of bounds [0," + nf(nodeCount) + ")");
}
代码示例来源:origin: com.graphhopper/graphhopper-core
@Override
public String getStatisticsString() {
return String.format(Locale.ROOT, "meanDegree: %.2f, dijkstras: %10s, mem: %10s",
meanDegree, nf(dijkstraCount), prepareAlgo.getMemoryUsageAsString());
}
代码示例来源:origin: com.graphhopper/graphhopper-core
private void logStats(int updateCounter) {
logger.info(String.format(Locale.ROOT,
"nodes: %10s, shortcuts: %10s, updates: %2d, checked-nodes: %10s, %s, %s, %s",
nf(sortedNodes.getSize()),
nf(nodeContractor.getAddedShortcutsCount()),
updateCounter,
nf(checkCounter),
getTimesAsString(),
nodeContractor.getStatisticsString(),
Helper.getMemInfo()));
}
代码示例来源:origin: com.graphhopper/graphhopper
String toDetailsString()
{
return "edges:" + nf(edgeCount) + "(" + edges.getCapacity() / Helper.MB + "MB), "
+ "nodes:" + nf(getNodes()) + "(" + nodes.getCapacity() / Helper.MB + "MB), "
+ "name:(" + nameIndex.getCapacity() / Helper.MB + "MB), "
+ "geo:" + nf(maxGeoRef) + "(" + wayGeometry.getCapacity() / Helper.MB + "MB), "
+ "bounds:" + bounds;
}
代码示例来源:origin: com.rgi-corp/graphhopper
String toDetailsString() {
return "edges:" + nf(edgeCount) + "(" + edges.getCapacity() / Helper.MB + "MB), "
+ "nodes:" + nf(getNodes()) + "(" + nodes.getCapacity() / Helper.MB + "MB), "
+ "name:(" + nameIndex.getCapacity() / Helper.MB + "MB), "
+ "geo:" + nf(maxGeoRef) + "(" + wayGeometry.getCapacity() / Helper.MB + "MB), "
+ "bounds:" + bounds;
}
代码示例来源:origin: com.graphhopper/graphhopper-core
String toDetailsString() {
return "edges:" + nf(edgeCount) + "(" + edges.getCapacity() / Helper.MB + "MB), "
+ "nodes:" + nf(getNodes()) + "(" + nodes.getCapacity() / Helper.MB + "MB), "
+ "name:(" + nameIndex.getCapacity() / Helper.MB + "MB), "
+ "geo:" + nf(maxGeoRef) + "(" + wayGeometry.getCapacity() / Helper.MB + "MB), "
+ "bounds:" + bounds;
}
代码示例来源:origin: com.graphhopper/graphhopper
String toDetailsString()
{
return toString() + ", shortcuts:" + nf(shortcutCount) + ", nodesCH:(" + nodesCH.getCapacity() / Helper.MB + "MB)";
}
代码示例来源:origin: com.rgi-corp/graphhopper
String toDetailsString() {
return toString() + ", shortcuts:" + nf(shortcutCount) + ", nodesCH:(" + nodesCH.getCapacity() / Helper.MB + "MB)";
}
代码示例来源:origin: com.graphhopper/graphhopper-core
String toDetailsString() {
return toString() + ", shortcuts:" + nf(shortcutCount) + ", nodesCH:(" + nodesCH.getCapacity() / Helper.MB + "MB)";
}
代码示例来源:origin: com.graphhopper/graphhopper-core
/**
* Internal method to clean up the graph.
*/
protected void cleanUp() {
int prevNodeCount = ghStorage.getNodes();
PrepareRoutingSubnetworks preparation = new PrepareRoutingSubnetworks(ghStorage, encodingManager.fetchEdgeEncoders());
preparation.setMinNetworkSize(minNetworkSize);
preparation.setMinOneWayNetworkSize(minOneWayNetworkSize);
preparation.doWork();
int currNodeCount = ghStorage.getNodes();
logger.info("edges: " + Helper.nf(ghStorage.getAllEdges().length()) + ", nodes " + Helper.nf(currNodeCount)
+ ", there were " + Helper.nf(preparation.getMaxSubnetworks())
+ " subnetworks. removed them => " + Helper.nf(prevNodeCount - currNodeCount)
+ " less nodes");
}
内容来源于网络,如有侵权,请联系作者删除!