mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
rename VehicleBuilder to Builder; adapt VehicleFleetManagerTest to
changes in VehicleFleetManager
This commit is contained in:
parent
c1849a9d5a
commit
7386ba7309
24 changed files with 137 additions and 91 deletions
|
|
@ -55,7 +55,7 @@ public class MultipleDepotExample {
|
|||
for(Coordinate depotCoord : Arrays.asList(firstDepotCoord,second,third,fourth)){
|
||||
for(int i=0;i<nuOfVehicles;i++){
|
||||
VehicleTypeImpl vehicleType = VehicleTypeImpl.Builder.newInstance(depotCounter + "_type", capacity).setCostPerDistance(1.0).build();
|
||||
Vehicle vehicle = VehicleImpl.VehicleBuilder.newInstance(depotCounter + "_" + (i+1) + "_vehicle").setLocationCoord(depotCoord).setType(vehicleType).build();
|
||||
Vehicle vehicle = VehicleImpl.Builder.newInstance(depotCounter + "_" + (i+1) + "_vehicle").setLocationCoord(depotCoord).setType(vehicleType).build();
|
||||
vrpBuilder.addVehicle(vehicle);
|
||||
}
|
||||
depotCounter++;
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public class MultipleDepotExampleWithPenaltyVehicles {
|
|||
for(int i=0;i<nuOfVehicles;i++){
|
||||
VehicleTypeImpl vehicleType = VehicleTypeImpl.Builder.newInstance(depotCounter + "_type", capacity).setCostPerDistance(1.0).build();
|
||||
String vehicleId = depotCounter + "_" + (i+1) + "_vehicle";
|
||||
VehicleImpl.VehicleBuilder vehicleBuilder = VehicleImpl.VehicleBuilder.newInstance(vehicleId);
|
||||
VehicleImpl.Builder vehicleBuilder = VehicleImpl.Builder.newInstance(vehicleId);
|
||||
vehicleBuilder.setLocationCoord(depotCoord);
|
||||
vehicleBuilder.setType(vehicleType);
|
||||
vehicleBuilder.setLatestArrival(maxDuration);
|
||||
|
|
@ -64,7 +64,7 @@ public class MultipleDepotExampleWithPenaltyVehicles {
|
|||
VehicleTypeImpl penaltyType = VehicleTypeImpl.Builder.newInstance(depotCounter + "_type", capacity).setFixedCost(50).setCostPerDistance(3.0).build();
|
||||
PenaltyVehicleType penaltyVehicleType = new PenaltyVehicleType(penaltyType);
|
||||
String vehicleId = depotCounter + "_vehicle#penalty";
|
||||
VehicleImpl.VehicleBuilder vehicleBuilder = VehicleImpl.VehicleBuilder.newInstance(vehicleId);
|
||||
VehicleImpl.Builder vehicleBuilder = VehicleImpl.Builder.newInstance(vehicleId);
|
||||
vehicleBuilder.setLocationCoord(depotCoord);
|
||||
vehicleBuilder.setType(penaltyVehicleType);
|
||||
vehicleBuilder.setLatestArrival(maxDuration);
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ public class RefuseCollectionExample {
|
|||
typeBuilder.setCostPerDistance(1.0);
|
||||
VehicleTypeImpl bigType = typeBuilder.build();
|
||||
|
||||
VehicleImpl.VehicleBuilder vehicleBuilder = VehicleImpl.VehicleBuilder.newInstance("vehicle");
|
||||
VehicleImpl.Builder vehicleBuilder = VehicleImpl.Builder.newInstance("vehicle");
|
||||
vehicleBuilder.setLocationId("1");
|
||||
vehicleBuilder.setType(bigType);
|
||||
Vehicle bigVehicle = vehicleBuilder.build();
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import basics.VehicleRoutingProblemSolution;
|
|||
import basics.io.VrpXMLWriter;
|
||||
import basics.route.Vehicle;
|
||||
import basics.route.VehicleImpl;
|
||||
import basics.route.VehicleImpl.VehicleBuilder;
|
||||
import basics.route.VehicleImpl.Builder;
|
||||
import basics.route.VehicleType;
|
||||
import basics.route.VehicleTypeImpl;
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ public class SimpleExample {
|
|||
/*
|
||||
* get a vehicle-builder and build a vehicle located at (10,10) with type "vehicleType"
|
||||
*/
|
||||
VehicleBuilder vehicleBuilder = VehicleImpl.VehicleBuilder.newInstance("vehicle");
|
||||
Builder vehicleBuilder = VehicleImpl.Builder.newInstance("vehicle");
|
||||
vehicleBuilder.setLocationCoord(Coordinate.newInstance(10, 10));
|
||||
vehicleBuilder.setType(vehicleType);
|
||||
Vehicle vehicle = vehicleBuilder.build();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue