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) + ")"); }
@Override public String getStatisticsString() { return String.format(Locale.ROOT, "meanDegree: %.2f, dijkstras: %10s, mem: %10s", meanDegree, nf(dijkstraCount), prepareAlgo.getMemoryUsageAsString()); }
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())); }
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; }
String toDetailsString() { return toString() + ", shortcuts:" + nf(shortcutCount) + ", nodesCH:(" + nodesCH.getCapacity() / Helper.MB + "MB)"; }
/** * 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"); }
@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)); }
@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; }
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) + ")"); }
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) + ")"); }
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) + ")"); }
@Override public String getStatisticsString() { return String.format(Locale.ROOT, "meanDegree: %.2f, dijkstras: %10s, mem: %10s", meanDegree, nf(dijkstraCount), prepareAlgo.getMemoryUsageAsString()); }
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())); }
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; }
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; }
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; }
String toDetailsString() { return toString() + ", shortcuts:" + nf(shortcutCount) + ", nodesCH:(" + nodesCH.getCapacity() / Helper.MB + "MB)"; }
String toDetailsString() { return toString() + ", shortcuts:" + nf(shortcutCount) + ", nodesCH:(" + nodesCH.getCapacity() / Helper.MB + "MB)"; }
String toDetailsString() { return toString() + ", shortcuts:" + nf(shortcutCount) + ", nodesCH:(" + nodesCH.getCapacity() / Helper.MB + "MB)"; }
/** * 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"); }