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

multiplePickupDeliverOptions (#51)

This commit is contained in:
kandelirina 2018-06-03 08:32:11 +03:00 committed by GitHub
parent efd1764dd3
commit 51f6fe4d28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 0 deletions

View file

@ -301,6 +301,7 @@ public class JobInsertionCostsCalculatorBuilder {
switcher.put(Pickup.class, serviceInsertion);
switcher.put(Delivery.class, serviceInsertion);
switcher.put(Break.class, breakInsertionCalculator);
switcher.put(ShipmentWithMutablePickupDeliverOptions.class, shipmentInsertion);
CalculatorPlusListeners calculatorPlusListeners = new CalculatorPlusListeners(switcher);
if (configLocal != null) {

View file

@ -0,0 +1,26 @@
package com.graphhopper.jsprit.core.problem.job;
import com.graphhopper.jsprit.core.problem.Location;
import java.util.ArrayList;
import java.util.List;
public class ShipmentWithMutablePickupDeliverOptions extends Shipment {
List<Location> pickupPossibleLocations = new ArrayList<>();
List<Location> deliverPossibleLocations = new ArrayList<>();
public ShipmentWithMutablePickupDeliverOptions(Builder builder, List<Location> pickupPossibleLocations, List<Location> deliverPossibleLocations) {
super(builder);
this.pickupPossibleLocations.addAll(pickupPossibleLocations);
this.deliverPossibleLocations.addAll(deliverPossibleLocations);
}
public List<Location> getDeliverPossibleLocations() {
return deliverPossibleLocations;
}
public List<Location> getPickupPossibleLocations() {
return pickupPossibleLocations;
}
}