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

further refinements

This commit is contained in:
oblonski 2013-06-20 17:25:53 +02:00
parent 665b4a8970
commit 5eaa288735
5 changed files with 32 additions and 15 deletions

View file

@ -54,7 +54,7 @@ public class MultipleDepotExampleWithPenaltyVehicles {
int depotCounter = 1;
for(Coordinate depotCoord : Arrays.asList(firstDepotCoord,second)){
for(int i=0;i<nuOfVehicles;i++){
VehicleType vehicleType = VehicleType.Builder.newInstance(depotCounter + "_" + (i+1) + "_type", capacity).setCostPerDistance(1.0).build();
VehicleType vehicleType = VehicleType.Builder.newInstance(depotCounter + "_type", capacity).setCostPerDistance(1.0).build();
String vehicleId = depotCounter + "_" + (i+1) + "_vehicle";
VehicleImpl.VehicleBuilder vehicleBuilder = VehicleImpl.VehicleBuilder.newInstance(vehicleId);
vehicleBuilder.setLocationCoord(depotCoord);
@ -63,16 +63,16 @@ public class MultipleDepotExampleWithPenaltyVehicles {
Vehicle vehicle = vehicleBuilder.build();
vrpBuilder.addVehicle(vehicle);
}
for(int i=0;i<nuOfPenaltyVehicles;i++){
VehicleType penaltyType = VehicleType.Builder.newInstance(depotCounter + "_" + (i+1) + "_type#penalty", capacity).setFixedCost(50).setCostPerDistance(3.0).build();
String vehicleId = depotCounter + "_" + (i+1) + "_vehicle#penalty";
// for(int i=0;i<nuOfPenaltyVehicles;i++){
VehicleType penaltyType = VehicleType.Builder.newInstance(depotCounter + "_type#penalty", capacity).setFixedCost(50).setCostPerDistance(3.0).build();
String vehicleId = depotCounter + "_vehicle#penalty";
VehicleImpl.VehicleBuilder vehicleBuilder = VehicleImpl.VehicleBuilder.newInstance(vehicleId);
vehicleBuilder.setLocationCoord(depotCoord);
vehicleBuilder.setType(penaltyType);
vehicleBuilder.setLatestArrival(maxDuration);
Vehicle penaltyVehicle = vehicleBuilder.build();
vrpBuilder.addVehicle(penaltyVehicle);
}
// }
depotCounter++;
}
@ -91,7 +91,7 @@ public class MultipleDepotExampleWithPenaltyVehicles {
/*
* plot to see how the problem looks like
*/
SolutionPlotter.plotVrpAsPNG(vrp, "output/problem08.png", "p08");
// SolutionPlotter.plotVrpAsPNG(vrp, "output/problem08.png", "p08");
/*
* solve the problem