This commit is contained in:
Victor Shcherb 2018-10-17 02:03:44 +02:00
parent ab68c74370
commit a114ba97f6
2 changed files with 18 additions and 10 deletions

View file

@ -396,7 +396,7 @@ public class BinaryRoutePlanner {
final RouteDataObject road = segment.road;
boolean initDirectionAllowed = checkIfInitialMovementAllowedOnSegment(ctx, reverseWaySearch, visitedSegments, segment, road);
if (TEST_SPECIFIC && road.getId() >> 6 == TEST_ID) {
printRoad(" ! " + +segment.distanceFromStart + " ", segment, reverseWaySearch);
printRoad(" ! " + segment.distanceFromStart + " ", segment, reverseWaySearch);
}
boolean directionAllowed = initDirectionAllowed;
if (!directionAllowed) {
@ -514,9 +514,11 @@ public class BinaryRoutePlanner {
directionAllowed = oneway >= 0;
}
}
if (directionAllowed && visitedSegments.containsKey(calculateRoutePointId(segment, segment.isPositive()))) {
directionAllowed = false;
RouteSegment visitedSegment = visitedSegments.get(calculateRoutePointId(segment, segment.isPositive()));
if (directionAllowed && visitedSegment != null) {
if (visitedSegment.distanceFromStart <= segment.distanceFromStart) {
directionAllowed = false;
}
}
return directionAllowed;
}

View file

@ -464,12 +464,18 @@ public class RouteResultPreparation {
double startLon = start.getLongitude();
double endLat = end.getLatitude();
double endLon = end.getLongitude();
String msg = MessageFormat.format("<test regions=\"\" description=\"\" best_percent=\"\" vehicle=\"{4}\" \n"
+ " start_lat=\"{0}\" start_lon=\"{1}\" target_lat=\"{2}\" target_lon=\"{3}\" {5} >",
startLat + "", startLon + "", endLat + "", endLon + "", ctx.config.routerName,
"loadedTiles = \"" + ctx.loadedTiles + "\" " + "visitedSegments = \"" + ctx.visitedSegments + "\" " +
"complete_distance = \"" + completeDistance + "\" " + "complete_time = \"" + completeTime + "\" " +
"routing_time = \"" + ctx.routingTime + "\" ");
String msg = String.format("<test regions=\"\" description=\"\" best_percent=\"\" vehicle=\"%s\" \n"
+ " start_lat=\"%.5f\" start_lon=\"%.5f\" target_lat=\"%.5f\" target_lon=\"%.5f\" "
+ " routing_time=\"%.2f\" loadedTiles=\"%d\" visitedSegments=\"%d\" complete_distance=\"%.2f\" complete_time=\"%.2f\" >",
ctx.config.routerName, startLat, startLon, endLat, endLon, ctx.routingTime, ctx.loadedTiles,
ctx.visitedSegments, completeDistance, completeTime);
// String msg = MessageFormat.format("<test regions=\"\" description=\"\" best_percent=\"\" vehicle=\"{4}\" \n"
// + " start_lat=\"{0}\" start_lon=\"{1}\" target_lat=\"{2}\" target_lon=\"{3}\" {5} >",
// startLat + "", startLon + "", endLat + "", endLon + "", ctx.config.routerName,
// "loadedTiles = \"" + ctx.loadedTiles + "\" " + "visitedSegments = \"" + ctx.visitedSegments + "\" " +
// "complete_distance = \"" + completeDistance + "\" " + "complete_time = \"" + completeTime + "\" " +
// "routing_time = \"" + ctx.routingTime + "\" ");
log.info(msg);
println(msg);
if (PRINT_TO_CONSOLE_ROUTE_INFORMATION_TO_TEST) {