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

some visualization features

This commit is contained in:
Stefan Schroeder 2013-12-10 16:02:23 +01:00
parent 73dfe5461d
commit 0717f5dd66
7 changed files with 247 additions and 15 deletions

View file

@ -19,6 +19,7 @@ package jsprit.examples;
import java.io.File;
import java.util.Collection;
import jsprit.analysis.toolbox.GraphStream;
import jsprit.analysis.toolbox.Plotter;
import jsprit.analysis.toolbox.SolutionPlotter;
import jsprit.analysis.toolbox.SolutionPrinter;
@ -71,7 +72,7 @@ public class SolomonExample {
*/
// VehicleRoutingAlgorithm vra = new SchrimpfFactory().createAlgorithm(vrp);
VehicleRoutingAlgorithm vra = VehicleRoutingAlgorithms.readAndCreateAlgorithm(vrp, "input/algorithmConfig_solomon.xml");
// vra.setPrematureBreak(100);
vra.setPrematureBreak(10);
// vra.getAlgorithmListeners().addListener(new AlgorithmSearchProgressChartListener("output/sol_progress.png"));
/*
* Solve the problem.
@ -98,7 +99,9 @@ public class SolomonExample {
plotter.plot("output/solomon_C101_solution.png", "C101");
// SolutionPlotter.plotSolutionAsPNG(vrp, solution, "output/solomon_C101_solution.png","C101");
// GraphStream.display(vrp,100);
GraphStream.display(vrp,solution);
}

View file

@ -19,6 +19,7 @@ package jsprit.examples;
import java.io.File;
import java.util.Collection;
import jsprit.analysis.toolbox.GraphStream;
import jsprit.analysis.toolbox.SolutionPlotter;
import jsprit.analysis.toolbox.SolutionPrinter;
import jsprit.core.algorithm.VehicleRoutingAlgorithm;
@ -93,6 +94,8 @@ public class SolomonOpenExample {
*/
SolutionPlotter.plotSolutionAsPNG(vrp, solution, "output/solomon_C101_open_solution.png","C101");
GraphStream.display(vrp, solution, 50, false);
}

View file

@ -20,6 +20,7 @@ import java.io.File;
import java.util.Collection;
import jsprit.analysis.toolbox.AlgorithmSearchProgressChartListener;
import jsprit.analysis.toolbox.GraphStream;
import jsprit.analysis.toolbox.Plotter;
import jsprit.analysis.toolbox.Plotter.Label;
import jsprit.analysis.toolbox.SolutionPrinter.Print;
@ -99,11 +100,12 @@ public class VRPWithBackhaulsExample {
/*
* Plot solution.
*/
Plotter plotter = new Plotter(vrp, solution);
plotter.setLabel(Label.SIZE);
plotter.setShowFirstActivity(true);
plotter.plot("output/vrpwbh_solomon_r101_solution.png","vrpwbh_r101");
// Plotter plotter = new Plotter(vrp, solution);
// plotter.setLabel(Label.SIZE);
// plotter.setShowFirstActivity(true);
// plotter.plot("output/vrpwbh_solomon_r101_solution.png","vrpwbh_r101");
GraphStream.display(vrp, solution, 100, true);
}