routing: Add objective to java sample

This commit is contained in:
Mizux Seiha
2021-04-15 14:34:08 +02:00
parent fdd9c96511
commit eee7be20ae
11 changed files with 27 additions and 1 deletions

View File

@@ -87,6 +87,9 @@ public class VrpResources {
/// @brief Print the solution.
static void printSolution(
DataModel data, RoutingModel routing, RoutingIndexManager manager, Assignment solution) {
// Solution cost.
logger.info("Objective : " + solution.objectiveValue());
// Inspect solution.
RoutingDimension timeDimension = routing.getMutableDimension("Time");
long totalTime = 0;
for (int i = 0; i < data.vehicleNumber; ++i) {