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

replaced penVehicle creation by copy constructor of vehicle

This commit is contained in:
oblonski 2014-06-29 19:40:47 +02:00
parent d093e090ef
commit 415cb597fe

View file

@ -353,12 +353,12 @@ public class VehicleRoutingProblem {
.setCapacityDimensions(v.getType().getCapacityDimensions())
.build();
PenaltyVehicleType penType = new PenaltyVehicleType(t,penaltyFactor);
String vehicleId = v.getId();
// String vehicleId = "penaltyVehicle_" + new VehicleTypeKey(v.getType().getTypeId(),v.getStartLocationId(),v.getEndLocationId(),v.getEarliestDeparture(),v.getLatestArrival()).toString();
Vehicle penVehicle = VehicleImpl.Builder.newInstance(vehicleId).setEarliestStart(v.getEarliestDeparture())
.setLatestArrival(v.getLatestArrival()).setStartLocationCoordinate(v.getStartLocationCoordinate()).setStartLocationId(v.getStartLocationId())
.setEndLocationId(v.getEndLocationId()).setEndLocationCoordinate(v.getEndLocationCoordinate())
.setReturnToDepot(v.isReturnToDepot()).setType(penType).build();
Vehicle penVehicle = VehicleImpl.copyAndCreateVehicleWithNewType(v, penType);
// String vehicleId = v.getId();
// Vehicle penVehicle = VehicleImpl.Builder.newInstance(vehicleId).setEarliestStart(v.getEarliestDeparture())
// .setLatestArrival(v.getLatestArrival()).setStartLocationCoordinate(v.getStartLocationCoordinate()).setStartLocationId(v.getStartLocationId())
// .setEndLocationId(v.getEndLocationId()).setEndLocationCoordinate(v.getEndLocationCoordinate())
// .setReturnToDepot(v.isReturnToDepot()).setType(penType).build();
addVehicle(penVehicle);
}
}