public Builder addPickup(Shipment shipment, TimeWindow pickupTimeWindow) { if (openShipments.contains(shipment)) throw new IllegalArgumentException("shipment has already been added. cannot add it twice."); List<AbstractActivity> acts = jobActivityFactory.createActivities(shipment); TourActivity act = acts.get(0); act.setTheoreticalEarliestOperationStartTime(pickupTimeWindow.getStart()); act.setTheoreticalLatestOperationStartTime(pickupTimeWindow.getEnd()); tourActivities.addActivity(act); openShipments.add(shipment); openActivities.put(shipment, acts.get(1)); return this; }
public Builder addDelivery(Shipment shipment, TimeWindow deliveryTimeWindow) { if (openShipments.contains(shipment)) { TourActivity act = openActivities.get(shipment); act.setTheoreticalEarliestOperationStartTime(deliveryTimeWindow.getStart()); act.setTheoreticalLatestOperationStartTime(deliveryTimeWindow.getEnd()); tourActivities.addActivity(act); openShipments.remove(shipment); } else { throw new IllegalArgumentException("cannot deliver shipment. shipment " + shipment + " needs to be picked up first."); } return this; }
public Builder addService(Service service, TimeWindow timeWindow) { if (service == null) throw new IllegalArgumentException("service must not be null"); List<AbstractActivity> acts = jobActivityFactory.createActivities(service); TourActivity act = acts.get(0); act.setTheoreticalEarliestOperationStartTime(timeWindow.getStart()); act.setTheoreticalLatestOperationStartTime(timeWindow.getEnd()); tourActivities.addActivity(act); return this; }
for(TimeWindow timeWindow : service.getTimeWindows()) { deliveryAct2Insert.setTheoreticalEarliestOperationStartTime(timeWindow.getStart()); deliveryAct2Insert.setTheoreticalLatestOperationStartTime(timeWindow.getEnd()); ActivityContext activityContext = new ActivityContext(); activityContext.setInsertionIndex(actIndex); deliveryAct2Insert.setTheoreticalLatestOperationStartTime(bestTimeWindow.getEnd()); insertionData.getEvents().add(new InsertActivity(currentRoute, newVehicle, deliveryAct2Insert, insertionIndex)); insertionData.getEvents().add(new SwitchVehicle(currentRoute,newVehicle,newVehicleDepartureTime));
for(TimeWindow pickupTimeWindow : shipment.getPickupTimeWindows()) { pickupShipment.setTheoreticalEarliestOperationStartTime(pickupTimeWindow.getStart()); pickupShipment.setTheoreticalLatestOperationStartTime(pickupTimeWindow.getEnd()); ActivityContext activityContext = new ActivityContext(); activityContext.setInsertionIndex(i); for (TimeWindow deliveryTimeWindow : shipment.getDeliveryTimeWindows()) { deliverShipment.setTheoreticalEarliestOperationStartTime(deliveryTimeWindow.getStart()); deliverShipment.setTheoreticalLatestOperationStartTime(deliveryTimeWindow.getEnd()); ActivityContext activityContext_ = new ActivityContext(); activityContext_.setInsertionIndex(j); pickupShipment.setTheoreticalLatestOperationStartTime(bestPickupTimeWindow.getEnd()); deliverShipment.setTheoreticalEarliestOperationStartTime(bestDeliveryTimeWindow.getStart()); deliverShipment.setTheoreticalLatestOperationStartTime(bestDeliveryTimeWindow.getEnd()); insertionData.setVehicleDepartureTime(newVehicleDepartureTime); insertionData.getEvents().add(new InsertActivity(currentRoute, newVehicle, deliverShipment, deliveryInsertionIndex));
for (TimeWindow pickupTimeWindow : shipment.getPickupTimeWindows()) { pickupShipment.setTheoreticalEarliestOperationStartTime(pickupTimeWindow.getStart()); pickupShipment.setTheoreticalLatestOperationStartTime(pickupTimeWindow.getEnd()); ActivityContext activityContext = new ActivityContext(); activityContext.setInsertionIndex(i); for (TimeWindow deliveryTimeWindow : shipment.getDeliveryTimeWindows()) { deliverShipment.setTheoreticalEarliestOperationStartTime(deliveryTimeWindow.getStart()); deliverShipment.setTheoreticalLatestOperationStartTime(deliveryTimeWindow.getEnd()); ActivityContext activityContext_ = new ActivityContext(); activityContext_.setInsertionIndex(j); pickupShipment.setTheoreticalLatestOperationStartTime(bestPickupTimeWindow.getEnd()); deliverShipment.setTheoreticalEarliestOperationStartTime(bestDeliveryTimeWindow.getStart()); deliverShipment.setTheoreticalLatestOperationStartTime(bestDeliveryTimeWindow.getEnd()); insertionData.setVehicleDepartureTime(newVehicleDepartureTime); insertionData.getEvents().add(new InsertActivity(currentRoute, newVehicle, deliverShipment, deliveryInsertionIndex));
public Builder addPickup(Shipment shipment, TimeWindow pickupTimeWindow) { if (openShipments.contains(shipment)) throw new IllegalArgumentException("shipment has already been added. cannot add it twice."); List<AbstractActivity> acts = jobActivityFactory.createActivities(shipment); TourActivity act = acts.get(0); act.setTheoreticalEarliestOperationStartTime(pickupTimeWindow.getStart()); act.setTheoreticalLatestOperationStartTime(pickupTimeWindow.getEnd()); tourActivities.addActivity(act); openShipments.add(shipment); openActivities.put(shipment, acts.get(1)); return this; }
public Builder addDelivery(Shipment shipment, TimeWindow deliveryTimeWindow) { if (openShipments.contains(shipment)) { TourActivity act = openActivities.get(shipment); act.setTheoreticalEarliestOperationStartTime(deliveryTimeWindow.getStart()); act.setTheoreticalLatestOperationStartTime(deliveryTimeWindow.getEnd()); tourActivities.addActivity(act); openShipments.remove(shipment); } else { throw new IllegalArgumentException("cannot deliver shipment. shipment " + shipment + " needs to be picked up first."); } return this; }
public Builder addService(Service service, TimeWindow timeWindow) { if (service == null) throw new IllegalArgumentException("service must not be null"); List<AbstractActivity> acts = jobActivityFactory.createActivities(service); TourActivity act = acts.get(0); act.setTheoreticalEarliestOperationStartTime(timeWindow.getStart()); act.setTheoreticalLatestOperationStartTime(timeWindow.getEnd()); tourActivities.addActivity(act); return this; }
for(TimeWindow timeWindow : service.getTimeWindows()) { deliveryAct2Insert.setTheoreticalEarliestOperationStartTime(timeWindow.getStart()); deliveryAct2Insert.setTheoreticalLatestOperationStartTime(timeWindow.getEnd()); ActivityContext activityContext = new ActivityContext(); activityContext.setInsertionIndex(actIndex); deliveryAct2Insert.setTheoreticalLatestOperationStartTime(bestTimeWindow.getEnd()); insertionData.getEvents().add(new InsertActivity(currentRoute, newVehicle, deliveryAct2Insert, insertionIndex)); insertionData.getEvents().add(new SwitchVehicle(currentRoute,newVehicle,newVehicleDepartureTime));
for(TimeWindow pickupTimeWindow : shipment.getPickupTimeWindows()) { pickupShipment.setTheoreticalEarliestOperationStartTime(pickupTimeWindow.getStart()); pickupShipment.setTheoreticalLatestOperationStartTime(pickupTimeWindow.getEnd()); ActivityContext activityContext = new ActivityContext(); activityContext.setInsertionIndex(i); for (TimeWindow deliveryTimeWindow : shipment.getDeliveryTimeWindows()) { deliverShipment.setTheoreticalEarliestOperationStartTime(deliveryTimeWindow.getStart()); deliverShipment.setTheoreticalLatestOperationStartTime(deliveryTimeWindow.getEnd()); ActivityContext activityContext_ = new ActivityContext(); activityContext_.setInsertionIndex(j); pickupShipment.setTheoreticalLatestOperationStartTime(bestPickupTimeWindow.getEnd()); deliverShipment.setTheoreticalEarliestOperationStartTime(bestDeliveryTimeWindow.getStart()); deliverShipment.setTheoreticalLatestOperationStartTime(bestDeliveryTimeWindow.getEnd()); insertionData.setVehicleDepartureTime(newVehicleDepartureTime); insertionData.getEvents().add(new InsertActivity(currentRoute, newVehicle, deliverShipment, deliveryInsertionIndex));