mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
added indeces to main elements
This commit is contained in:
parent
aa1b7214ae
commit
4f2689529f
33 changed files with 512 additions and 243 deletions
|
|
@ -16,12 +16,9 @@
|
|||
******************************************************************************/
|
||||
package jsprit.examples;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import jsprit.analysis.toolbox.GraphStreamViewer;
|
||||
import jsprit.analysis.toolbox.GraphStreamViewer.Label;
|
||||
import jsprit.analysis.toolbox.Plotter;
|
||||
|
||||
import jsprit.analysis.toolbox.SolutionPrinter;
|
||||
import jsprit.analysis.toolbox.SolutionPrinter.Print;
|
||||
import jsprit.core.algorithm.VehicleRoutingAlgorithm;
|
||||
|
|
@ -29,9 +26,13 @@ import jsprit.core.algorithm.io.VehicleRoutingAlgorithms;
|
|||
import jsprit.core.algorithm.selector.SelectBest;
|
||||
import jsprit.core.problem.VehicleRoutingProblem;
|
||||
import jsprit.core.problem.solution.VehicleRoutingProblemSolution;
|
||||
import jsprit.core.problem.solution.route.VehicleRoute;
|
||||
import jsprit.core.problem.solution.route.activity.TourActivity;
|
||||
import jsprit.instance.reader.SolomonReader;
|
||||
import jsprit.util.Examples;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
|
||||
public class SolomonExample {
|
||||
|
||||
|
|
@ -80,7 +81,14 @@ public class SolomonExample {
|
|||
* Retrieve best solution.
|
||||
*/
|
||||
VehicleRoutingProblemSolution solution = new SelectBest().selectSolution(solutions);
|
||||
|
||||
|
||||
for(VehicleRoute r : solution.getRoutes()){
|
||||
System.out.println(r.getStart() + ";" + r.getStart().getIndex());
|
||||
for(TourActivity act : r.getActivities()){
|
||||
System.out.println(act + ";" + act.getIndex());
|
||||
}
|
||||
System.out.println(r.getEnd() + ";" + r.getEnd().getIndex());
|
||||
}
|
||||
/*
|
||||
* print solution
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue