diff --git a/jsprit-core/src/main/java/com/graphhopper/jsprit/core/algorithm/VehicleRoutingAlgorithm.java b/jsprit-core/src/main/java/com/graphhopper/jsprit/core/algorithm/VehicleRoutingAlgorithm.java index 18ea6e1d..5df299fc 100644 --- a/jsprit-core/src/main/java/com/graphhopper/jsprit/core/algorithm/VehicleRoutingAlgorithm.java +++ b/jsprit-core/src/main/java/com/graphhopper/jsprit/core/algorithm/VehicleRoutingAlgorithm.java @@ -222,18 +222,27 @@ public class VehicleRoutingAlgorithm { double now = System.currentTimeMillis(); int noIterationsThisAlgoIsRunning = maxIterations; counter.reset(); + logger.info("algorithmStarts func call"); algorithmStarts(problem, solutions); bestEver = Solutions.bestOf(solutions); + logger.info("algorithmStarts func call finished successfully best till now cost: {}, routes: {}, unassigned: {}", bestEver.getCost(), bestEver.getRoutes().size(), bestEver.getUnassignedJobs().size()); if (logger.isTraceEnabled()) { log(solutions); } - logger.info("iterations start"); for (int i = 0; i < maxIterations; i++) { iterationStarts(i + 1, problem, solutions); logger.debug("start iteration: {}", i); counter.incCounter(); SearchStrategy strategy = searchStrategyManager.getRandomStrategy(); + if (i % 10 == 0) { + logger.info("selected strategy {}", strategy.getName()); + } + DiscoveredSolution discoveredSolution = strategy.run(problem, solutions); + if (i % 10 == 0) { + logger.info("discoveredSolution: cost: {}, routes: {}, unassigned: {}", discoveredSolution.getSolution().getCost(), discoveredSolution.getSolution().getRoutes().size(), discoveredSolution.getSolution().getUnassignedJobs().size()); + } + if (logger.isTraceEnabled()) { log(discoveredSolution); } diff --git a/jsprit-io/src/main/java/com/graphhopper/jsprit/io/algorithm/VehicleRoutingAlgorithms.java b/jsprit-io/src/main/java/com/graphhopper/jsprit/io/algorithm/VehicleRoutingAlgorithms.java index 2b09b978..02f03ff0 100644 --- a/jsprit-io/src/main/java/com/graphhopper/jsprit/io/algorithm/VehicleRoutingAlgorithms.java +++ b/jsprit-io/src/main/java/com/graphhopper/jsprit/io/algorithm/VehicleRoutingAlgorithms.java @@ -475,9 +475,9 @@ public class VehicleRoutingAlgorithms { // stateManager.addStateUpdater(new UpdateActivityTimes(vrp.getTransportCosts())); // stateManager.addStateUpdater(new UpdateVariableCosts(vrp.getActivityCosts(), vrp.getTransportCosts(), stateManager)); - /* + /* * define constraints - */ + */ //constraint manager if (constraintManager == null) constraintManager = new ConstraintManager(vrp, stateManager); @@ -536,13 +536,13 @@ public class VehicleRoutingAlgorithms { @Override public void uncaughtException(Thread arg0, Throwable arg1) { - System.err.println(arg1.toString()); + log.error("error: {}", arg1.toString()); } }); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { if (!executorService.isShutdown()) { - System.err.println("shutdowHook shuts down executorService"); + log.error("shutdowHook shuts down executorService"); executorService.shutdown(); } }