Skip to content

Commit

Permalink
fix routing example
Browse files Browse the repository at this point in the history
  • Loading branch information
lperron committed Jan 28, 2025
1 parent 749899c commit 94c517c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ortools/routing/samples/VrpSolutionCallback.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ static void printSolution(RoutingIndexManager routingManager, RoutingModel routi
// Inspect solution.
long totalDistance = 0;
for (int i = 0; i < routingManager.getNumberOfVehicles(); ++i) {
if (routingModel.isEnd(routingModel.nextVar(index).value())) {
continue;
if (routingModel.activeVehicleVar(i).value() == 0) {
continue;
}
logger.info("Route for Vehicle " + i + ":");
long routeDistance = 0;
Expand Down

0 comments on commit 94c517c

Please sign in to comment.