Skip to content

Commit 94c517c

Browse files
committed
fix routing example
1 parent 749899c commit 94c517c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ortools/routing/samples/VrpSolutionCallback.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ static void printSolution(RoutingIndexManager routingManager, RoutingModel routi
6767
// Inspect solution.
6868
long totalDistance = 0;
6969
for (int i = 0; i < routingManager.getNumberOfVehicles(); ++i) {
70-
if (routingModel.isEnd(routingModel.nextVar(index).value())) {
71-
continue;
70+
if (routingModel.activeVehicleVar(i).value() == 0) {
71+
continue;
7272
}
7373
logger.info("Route for Vehicle " + i + ":");
7474
long routeDistance = 0;

0 commit comments

Comments
 (0)