mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
Update MultipleDepotWithInitialRoutesExample.java
This commit is contained in:
parent
231435bbcf
commit
1f2e15a6d9
1 changed files with 10 additions and 2 deletions
|
|
@ -48,9 +48,13 @@ public class MultipleDepotWithInitialRoutesExample {
|
|||
|
||||
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
|
||||
/*
|
||||
* Read cordeau-instance p01, BUT only its services without any vehicles
|
||||
* Read cordeau-instance p01
|
||||
*/
|
||||
new VrpXMLReader(vrpBuilder).read("input/cordeau01.xml");
|
||||
|
||||
/*
|
||||
* Add initial route with 1_4_vehicle and services 44, 26
|
||||
*/
|
||||
VehicleRoute initialRoute = VehicleRoute.Builder.newInstance(getVehicle("1_4_vehicle",vrpBuilder)).addService(getService("44",vrpBuilder))
|
||||
.addService(getService("26",vrpBuilder)).build();
|
||||
vrpBuilder.addInitialVehicleRoute(initialRoute);
|
||||
|
|
@ -59,8 +63,12 @@ public class MultipleDepotWithInitialRoutesExample {
|
|||
* build the problem
|
||||
*/
|
||||
VehicleRoutingProblem vrp = vrpBuilder.build();
|
||||
/*
|
||||
* since job (service) 26 and 44 are already planned in initial route and thus static AND sequence is fixed they
|
||||
* should not be in jobMap anymore (only variable jobs are in jobMap)
|
||||
*/
|
||||
assert !vrp.getJobs().containsKey("26") : "strange. service 26 should not be part of the problem";
|
||||
assert !vrp.getJobs().containsKey("44") : "strange. service 26 should not be part of the problem";
|
||||
assert !vrp.getJobs().containsKey("44") : "strange. service 44 should not be part of the problem";
|
||||
|
||||
/*
|
||||
* plot to see how the problem looks like
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue