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

Switch to Activity- and RouteVisitor

This commit is contained in:
oblonski 2013-10-07 11:02:39 +02:00
parent 8c8f041933
commit a32d8c1c6a
14 changed files with 447 additions and 226 deletions

View file

@ -104,7 +104,7 @@ public class PickupAndDeliveryExample2 {
Plotter plotter = new Plotter(vrp, solution);
plotter.setLabel(Label.SIZE);
plotter.setShowFirstActivity(true);
plotter.plot("output/pd_christophides_vrpnc1.png","pd_vrpnc1");
plotter.plot("output/pd_christophides_vrpnc1_solution.png","pd_vrpnc1");

View file

@ -35,7 +35,11 @@ import basics.VehicleRoutingAlgorithm;
import basics.VehicleRoutingProblem;
import basics.VehicleRoutingProblemSolution;
import basics.VehicleRoutingProblem.Constraint;
import basics.costs.VehicleRoutingActivityCosts;
import basics.io.VrpXMLReader;
import basics.route.Driver;
import basics.route.TourActivity;
import basics.route.Vehicle;
public class VRPWithBackhaulsExample {
@ -68,9 +72,10 @@ public class VRPWithBackhaulsExample {
* Finally, the problem can be built. By default, transportCosts are crowFlyDistances (as usually used for vrp-instances).
*/
vrpBuilder.addProblemConstraint(Constraint.DELIVERIES_FIRST);
VehicleRoutingProblem vrp = vrpBuilder.build();
SolutionPlotter.plotVrpAsPNG(vrp, "output/pd_solomon_r101.png", "pd_r101");
// SolutionPlotter.plotVrpAsPNG(vrp, "output/vrpwbh_solomon_r101.png", "pd_r101");
/*
* Define the required vehicle-routing algorithms to solve the above problem.
@ -103,7 +108,7 @@ public class VRPWithBackhaulsExample {
Plotter plotter = new Plotter(vrp, solution);
plotter.setLabel(Label.SIZE);
plotter.setShowFirstActivity(true);
plotter.plot("output/pd_withBackhauls_solomon_r101_solution.png","pd_withBackhauls_r101");
plotter.plot("output/vrpwbh_solomon_r101_solution.png","vrpwbh_r101");
}

View file

@ -74,7 +74,7 @@ public class VRPWithBackhaulsExample2 {
*/
VehicleRoutingProblem vrp = vrpBuilder.build();
SolutionPlotter.plotVrpAsPNG(vrp, "output/pd_christophides_vrpnc1.png", "pd_vrpnc1");
SolutionPlotter.plotVrpAsPNG(vrp, "output/vrpwbh_christophides_vrpnc1.png", "pd_vrpnc1");
/*
* Define the required vehicle-routing algorithms to solve the above problem.
@ -107,7 +107,7 @@ public class VRPWithBackhaulsExample2 {
Plotter plotter = new Plotter(vrp, solution);
plotter.setLabel(Label.SIZE);
plotter.setShowFirstActivity(true);
plotter.plot("output/vrpwbh_christophides_vrpnc1.png","vrpwbh_vrpnc1");
plotter.plot("output/vrpwbh_christophides_vrpnc1_solution.png","vrpwbh_vrpnc1");