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:
parent
d093e090ef
commit
415cb597fe
1 changed files with 6 additions and 6 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue