Handles distinction of no-route vs invalid-route in mld alternatives

The viaroute plugin always expects a route to be there potentially
with invalid edge weight to represent no-route-found. By switching
to the many-route-result for the mld alternatives algorithm we might
return an empty many-route-result invalidating the post-condition.
This commit is contained in:
Daniel J. Hofmann
2017-07-22 12:36:53 +02:00
parent 58811d8f5c
commit f7c8bac3fd
2 changed files with 12 additions and 2 deletions
+4 -1
View File
@@ -120,9 +120,12 @@ Status ViaRoutePlugin::HandleRequest(const RoutingAlgorithmsInterface &algorithm
routes = algorithms.ShortestPathSearch(start_end_nodes, route_parameters.continue_straight);
}
// The post condition for all path searches is we have at least one route in our result.
// This route might be invalid by means of INVALID_EDGE_WEIGHT as shortest path weight.
BOOST_ASSERT(!routes.routes.empty());
// we can only know this after the fact, different SCC ids still
// allow for connection in one direction.
BOOST_ASSERT(!routes.routes.empty());
if (routes.routes[0].is_valid())
{