1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

add comments

This commit is contained in:
Stefan Schroeder 2013-11-26 15:47:25 +01:00
parent 37df98b542
commit 8b41c8d2d0

View file

@ -102,17 +102,26 @@ public class SimpleEnRoutePickupAndDeliveryExample {
*/
VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions);
/*
* write out problem and solution to xml-file
*/
new VrpXMLWriter(problem, solutions).write("output/shipment-problem-with-solution.xml");
/*
* print nRoutes and totalCosts of bestSolution
*/
SolutionPrinter.print(bestSolution);
/*
* plot
* plot problem without solution
*/
Plotter problemPlotter = new Plotter(problem);
problemPlotter.plotShipments(true);
problemPlotter.plot("output/simpleEnRoutePickupAndDeliveryExample_problem.png", "en-route pickup and delivery");
/*
* plot problem with solution
*/
Plotter solutionPlotter = new Plotter(problem,Arrays.asList(Solutions.bestOf(solutions).getRoutes().iterator().next()));
solutionPlotter.plotShipments(true);
solutionPlotter.plot("output/simpleEnRoutePickupAndDeliveryExample_solution.png", "en-route pickup and delivery");