Change roads to segments

This commit is contained in:
Victor Shcherb 2019-08-05 16:11:31 +02:00
parent b39a608400
commit 851a8ed86f

View file

@ -69,7 +69,6 @@ public class BinaryRoutePlanner {
RouteSegment recalculationEnd ) throws InterruptedException, IOException {
// measure time
ctx.timeToLoad = 0;
ctx.visitedSegments = 0;
ctx.memoryOverhead = 1000;
@ -122,7 +121,7 @@ public class BinaryRoutePlanner {
if (ctx.memoryOverhead > ctx.config.memoryLimitation * 0.95) {
throw new IllegalStateException("There is no enough memory " + ctx.config.memoryLimitation / (1 << 20) + " Mb");
}
ctx.visitedSegments++;
if (forwardSearch) {
boolean doNotAddIntersections = onlyBackward;
processRouteSegment(ctx, false, graphDirectSegments, visitedDirectSegments,
@ -166,6 +165,7 @@ public class BinaryRoutePlanner {
throw new InterruptedException("Route calculation interrupted");
}
}
ctx.visitedSegments = visitedDirectSegments.size() + visitedOppositeSegments.size();
printDebugMemoryInformation(ctx, graphDirectSegments, graphReverseSegments, visitedDirectSegments, visitedOppositeSegments);
return finalSegment;
}
@ -377,7 +377,7 @@ public class BinaryRoutePlanner {
printInfo("Loaded tiles " + ctx.loadedTiles + " (distinct " + ctx.distinctLoadedTiles + "), unloaded tiles " + ctx.unloadedTiles +
", loaded more than once same tiles "
+ ctx.loadedPrevUnloadedTiles);
printInfo("Visited roads " + ctx.visitedSegments + ", relaxed roads " + ctx.relaxedSegments);
printInfo("Visited segments " + ctx.visitedSegments + ", relaxed roads " + ctx.relaxedSegments);
if (graphDirectSegments != null && graphReverseSegments != null) {
printInfo("Priority queues sizes : " + graphDirectSegments.size() + "/" + graphReverseSegments.size());
}