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

shift from vehicle.getLocation() to vehicle.getStartLocation() and

vehicle.getCoord() to vehicle.getStartLocationCoordinate()
This commit is contained in:
Stefan Schroeder 2014-01-28 17:40:13 +01:00
parent e5dabbdf64
commit a234bb54c9
36 changed files with 195 additions and 137 deletions

View file

@ -7,7 +7,7 @@
<construction>
<insertion name="bestInsertion">
<considerFixedCosts>1.0</considerFixedCosts>
<considerFixedCosts weight="1.0">true</considerFixedCosts>
</insertion>
</construction>

View file

@ -318,7 +318,7 @@ public class BicycleMessenger {
static double getTimeOfDirectRoute(Job job, Vehicle v, VehicleRoutingTransportCosts routingCosts) {
Shipment envelope = (Shipment) job;
double direct = routingCosts.getTransportTime(v.getLocationId(), envelope.getPickupLocation(), 0.0, DriverImpl.noDriver(), v) +
double direct = routingCosts.getTransportTime(v.getStartLocationId(), envelope.getPickupLocation(), 0.0, DriverImpl.noDriver(), v) +
routingCosts.getTransportTime(envelope.getPickupLocation(), envelope.getDeliveryLocation(), 0.0, DriverImpl.noDriver(), v);
return direct;
}

View file

@ -19,7 +19,7 @@ package jsprit.examples;
import java.io.File;
import java.util.Collection;
import jsprit.analysis.toolbox.SolutionPlotter;
import jsprit.analysis.toolbox.Plotter;
import jsprit.analysis.toolbox.SolutionPrinter;
import jsprit.core.algorithm.VehicleRoutingAlgorithm;
import jsprit.core.algorithm.io.AlgorithmConfig;
@ -106,7 +106,7 @@ public class ConfigureAlgorithmInCodeInsteadOfPerXml {
/*
* plot
*/
SolutionPlotter.plotSolutionAsPNG(problem, bestSolution, "output/solution.png", "solution");
new Plotter(problem,bestSolution).plot("output/solution.png", "solution");
}
private static AlgorithmConfig getAlgorithmConfig() {

View file

@ -19,7 +19,7 @@ package jsprit.examples;
import java.io.File;
import java.util.Collection;
import jsprit.analysis.toolbox.SolutionPlotter;
import jsprit.analysis.toolbox.Plotter;
import jsprit.analysis.toolbox.SolutionPrinter;
import jsprit.core.algorithm.VehicleRoutingAlgorithm;
import jsprit.core.algorithm.io.VehicleRoutingAlgorithms;
@ -110,9 +110,9 @@ public class CostMatrixExample {
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
SolutionPrinter.print(Solutions.bestOf(solutions));
SolutionPlotter.plotSolutionAsPNG(vrp, Solutions.bestOf(solutions), "output/yo.png", "po");
new Plotter(vrp, Solutions.bestOf(solutions)).plot("output/yo.png", "po");
}
}

View file

@ -22,7 +22,7 @@ import java.util.Collection;
import jsprit.analysis.toolbox.AlgorithmSearchProgressChartListener;
import jsprit.analysis.toolbox.GraphStreamViewer;
import jsprit.analysis.toolbox.SolutionPlotter;
import jsprit.analysis.toolbox.Plotter;
import jsprit.analysis.toolbox.SolutionPrinter;
import jsprit.analysis.toolbox.StopWatch;
import jsprit.core.algorithm.VehicleRoutingAlgorithm;
@ -112,8 +112,9 @@ public class MultipleDepotExample {
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
SolutionPrinter.print(Solutions.bestOf(solutions));
SolutionPlotter.plotSolutionAsPNG(vrp, Solutions.bestOf(solutions), "output/p01_solution.png", "p01");
new Plotter(vrp, Solutions.bestOf(solutions)).plot("output/p01_solution.png", "p01");
new GraphStreamViewer(vrp, Solutions.bestOf(solutions)).setRenderDelay(100).display();
}

View file

@ -22,10 +22,10 @@ import java.util.Collection;
import jsprit.analysis.toolbox.AlgorithmSearchProgressChartListener;
import jsprit.analysis.toolbox.GraphStreamViewer;
import jsprit.analysis.toolbox.SolutionPlotter;
import jsprit.analysis.toolbox.Plotter;
import jsprit.analysis.toolbox.SolutionPrinter;
import jsprit.analysis.toolbox.StopWatch;
import jsprit.analysis.toolbox.SolutionPrinter.Print;
import jsprit.analysis.toolbox.StopWatch;
import jsprit.core.algorithm.VehicleRoutingAlgorithm;
import jsprit.core.algorithm.io.VehicleRoutingAlgorithms;
import jsprit.core.algorithm.listener.VehicleRoutingAlgorithmListeners.Priority;
@ -140,8 +140,9 @@ public class MultipleDepotExampleWithPenaltyVehicles {
Collection<VehicleRoutingProblemSolution> solutions = vra.searchSolutions();
SolutionPrinter.print(vrp,Solutions.bestOf(solutions),Print.VERBOSE);
SolutionPlotter.plotSolutionAsPNG(vrp, Solutions.bestOf(solutions), "output/p08_solution.png", "p08");
new Plotter(vrp, Solutions.bestOf(solutions)).plot("output/p08_solution.png", "p08");
new GraphStreamViewer(vrp,Solutions.bestOf(solutions)).setRenderDelay(50).display();
}

View file

@ -22,7 +22,6 @@ import java.util.Collection;
import jsprit.analysis.toolbox.AlgorithmSearchProgressChartListener;
import jsprit.analysis.toolbox.Plotter;
import jsprit.analysis.toolbox.Plotter.Label;
import jsprit.analysis.toolbox.SolutionPlotter;
import jsprit.analysis.toolbox.SolutionPrinter;
import jsprit.core.algorithm.VehicleRoutingAlgorithm;
import jsprit.core.algorithm.io.VehicleRoutingAlgorithms;
@ -65,7 +64,8 @@ public class PickupAndDeliveryExample {
VehicleRoutingProblem vrp = vrpBuilder.build();
SolutionPlotter.plotVrpAsPNG(vrp, "output/pd_solomon_r101.png", "pd_r101");
new Plotter(vrp).plot("output/pd_solomon_r101.png", "pd_r101");
/*
* Define the required vehicle-routing algorithms to solve the above problem.

View file

@ -23,7 +23,6 @@ import jsprit.analysis.toolbox.AlgorithmSearchProgressChartListener;
import jsprit.analysis.toolbox.GraphStreamViewer;
import jsprit.analysis.toolbox.Plotter;
import jsprit.analysis.toolbox.Plotter.Label;
import jsprit.analysis.toolbox.SolutionPlotter;
import jsprit.analysis.toolbox.SolutionPrinter;
import jsprit.core.algorithm.VehicleRoutingAlgorithm;
import jsprit.core.algorithm.io.VehicleRoutingAlgorithms;
@ -71,7 +70,8 @@ public class PickupAndDeliveryExample2 {
VehicleRoutingProblem vrp = vrpBuilder.build();
SolutionPlotter.plotVrpAsPNG(vrp, "output/pd_christophides_vrpnc1.png", "pd_vrpnc1");
new Plotter(vrp).plot("output/pd_christophides_vrpnc1.png", "pd_vrpnc1");
/*
* Define the required vehicle-routing algorithms to solve the above problem.

View file

@ -19,7 +19,7 @@ package jsprit.examples;
import java.io.File;
import java.util.Collection;
import jsprit.analysis.toolbox.SolutionPlotter;
import jsprit.analysis.toolbox.Plotter;
import jsprit.analysis.toolbox.SolutionPrinter;
import jsprit.core.algorithm.VehicleRoutingAlgorithm;
import jsprit.core.algorithm.io.VehicleRoutingAlgorithms;
@ -105,7 +105,9 @@ public class SimpleExampleOpenRoutes {
/*
* plot
*/
SolutionPlotter.plotSolutionAsPNG(problem, bestSolution, "output/solution.png", "solution");
new Plotter(problem, bestSolution).plot("output/solution.png", "solution");
}
}

View file

@ -20,10 +20,9 @@ import java.io.File;
import java.util.Collection;
import jsprit.analysis.toolbox.GraphStreamViewer;
import jsprit.analysis.toolbox.Plotter;
import jsprit.analysis.toolbox.SolutionPlotter;
import jsprit.analysis.toolbox.SolutionPrinter;
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;
import jsprit.core.algorithm.io.VehicleRoutingAlgorithms;
@ -64,7 +63,7 @@ public class SolomonExample {
*/
VehicleRoutingProblem vrp = vrpBuilder.build();
SolutionPlotter.plotVrpAsPNG(vrp, "output/solomon_C101.png", "C101");
new Plotter(vrp).plot("output/solomon_C101.png", "C101");
/*
* Define the required vehicle-routing algorithms to solve the above problem.

View file

@ -20,9 +20,9 @@ import java.io.File;
import java.util.Collection;
import jsprit.analysis.toolbox.GraphStreamViewer;
import jsprit.analysis.toolbox.SolutionPlotter;
import jsprit.analysis.toolbox.SolutionPrinter;
import jsprit.analysis.toolbox.GraphStreamViewer.Label;
import jsprit.analysis.toolbox.Plotter;
import jsprit.analysis.toolbox.SolutionPrinter;
import jsprit.core.algorithm.VehicleRoutingAlgorithm;
import jsprit.core.algorithm.io.VehicleRoutingAlgorithms;
import jsprit.core.algorithm.selector.SelectBest;
@ -62,7 +62,7 @@ public class SolomonOpenExample {
*/
VehicleRoutingProblem vrp = vrpBuilder.build();
SolutionPlotter.plotVrpAsPNG(vrp, "output/solomon_C101_open.png", "C101");
new Plotter(vrp).plot("output/solomon_C101_open.png", "C101");
/*
* Define the required vehicle-routing algorithms to solve the above problem.

View file

@ -19,7 +19,7 @@ package jsprit.examples;
import java.io.File;
import java.util.Collection;
import jsprit.analysis.toolbox.SolutionPlotter;
import jsprit.analysis.toolbox.Plotter;
import jsprit.analysis.toolbox.SolutionPrinter;
import jsprit.core.algorithm.VehicleRoutingAlgorithm;
import jsprit.core.algorithm.io.VehicleRoutingAlgorithms;
@ -60,7 +60,7 @@ public class SolomonR101Example {
*/
VehicleRoutingProblem vrp = vrpBuilder.build();
SolutionPlotter.plotVrpAsPNG(vrp, "output/solomon_R101.png", "R101");
new Plotter(vrp).plot("output/solomon_R101.png", "R101");
/*
* Define the required vehicle-routing algorithms to solve the above problem.
@ -91,9 +91,7 @@ public class SolomonR101Example {
/*
* Plot solution.
*/
SolutionPlotter.plotSolutionAsPNG(vrp, solution, "output/solomon_R101_solution.png","R101");
new Plotter(vrp,solution).plot( "output/solomon_R101_solution.png","R101");
}

View file

@ -21,7 +21,6 @@ import java.util.Collection;
import jsprit.analysis.toolbox.Plotter;
import jsprit.analysis.toolbox.Plotter.Label;
import jsprit.analysis.toolbox.SolutionPlotter;
import jsprit.analysis.toolbox.SolutionPrinter;
import jsprit.core.algorithm.VehicleRoutingAlgorithm;
import jsprit.core.algorithm.io.VehicleRoutingAlgorithms;
@ -69,7 +68,8 @@ public class VRPWithBackhaulsExample2 {
*/
VehicleRoutingProblem vrp = vrpBuilder.build();
SolutionPlotter.plotVrpAsPNG(vrp, "output/vrpwbh_christophides_vrpnc1.png", "pd_vrpnc1");
new Plotter(vrp).plot("output/vrpwbh_christophides_vrpnc1.png", "pd_vrpnc1");
/*
* Define the required vehicle-routing algorithms to solve the above problem.