mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
mod example
This commit is contained in:
parent
5eaa288735
commit
4c4d9ea96d
1 changed files with 9 additions and 14 deletions
|
|
@ -47,10 +47,6 @@ public class MultipleDepotExampleWithPenaltyVehicles {
|
||||||
Coordinate firstDepotCoord = Coordinate.newInstance(-33, 33);
|
Coordinate firstDepotCoord = Coordinate.newInstance(-33, 33);
|
||||||
Coordinate second = Coordinate.newInstance(33, -33);
|
Coordinate second = Coordinate.newInstance(33, -33);
|
||||||
|
|
||||||
/*
|
|
||||||
* number of penalty vehicles
|
|
||||||
*/
|
|
||||||
int nuOfPenaltyVehicles = 4;
|
|
||||||
int depotCounter = 1;
|
int depotCounter = 1;
|
||||||
for(Coordinate depotCoord : Arrays.asList(firstDepotCoord,second)){
|
for(Coordinate depotCoord : Arrays.asList(firstDepotCoord,second)){
|
||||||
for(int i=0;i<nuOfVehicles;i++){
|
for(int i=0;i<nuOfVehicles;i++){
|
||||||
|
|
@ -63,7 +59,6 @@ public class MultipleDepotExampleWithPenaltyVehicles {
|
||||||
Vehicle vehicle = vehicleBuilder.build();
|
Vehicle vehicle = vehicleBuilder.build();
|
||||||
vrpBuilder.addVehicle(vehicle);
|
vrpBuilder.addVehicle(vehicle);
|
||||||
}
|
}
|
||||||
// for(int i=0;i<nuOfPenaltyVehicles;i++){
|
|
||||||
VehicleType penaltyType = VehicleType.Builder.newInstance(depotCounter + "_type#penalty", capacity).setFixedCost(50).setCostPerDistance(3.0).build();
|
VehicleType penaltyType = VehicleType.Builder.newInstance(depotCounter + "_type#penalty", capacity).setFixedCost(50).setCostPerDistance(3.0).build();
|
||||||
String vehicleId = depotCounter + "_vehicle#penalty";
|
String vehicleId = depotCounter + "_vehicle#penalty";
|
||||||
VehicleImpl.VehicleBuilder vehicleBuilder = VehicleImpl.VehicleBuilder.newInstance(vehicleId);
|
VehicleImpl.VehicleBuilder vehicleBuilder = VehicleImpl.VehicleBuilder.newInstance(vehicleId);
|
||||||
|
|
@ -72,7 +67,7 @@ public class MultipleDepotExampleWithPenaltyVehicles {
|
||||||
vehicleBuilder.setLatestArrival(maxDuration);
|
vehicleBuilder.setLatestArrival(maxDuration);
|
||||||
Vehicle penaltyVehicle = vehicleBuilder.build();
|
Vehicle penaltyVehicle = vehicleBuilder.build();
|
||||||
vrpBuilder.addVehicle(penaltyVehicle);
|
vrpBuilder.addVehicle(penaltyVehicle);
|
||||||
// }
|
|
||||||
depotCounter++;
|
depotCounter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue