Builder(String id){ this.id = id; timeWindows = new TimeWindowsImpl(); timeWindows.add(TimeWindow.newInstance(0.0, Double.MAX_VALUE)); }
@Override public AbstractActivity createActivity(Service service) { AbstractActivity act; if (service instanceof Pickup) { act = new PickupService((Pickup) service); } else if (service instanceof Delivery) { act = new DeliverService((Delivery) service); } else { act = new PickupService(service); } return act; }
public End(End end) { this.location = end.getLocation(); // this.locationId = end.getLocation().getId(); theoretical_earliestOperationStartTime = end.getTheoreticalEarliestOperationStartTime(); theoretical_latestOperationStartTime = end.getTheoreticalLatestOperationStartTime(); arrTime = end.getArrTime(); endTime = end.getEndTime(); setIndex(-2); }
private Start(Start start) { this.location = start.getLocation(); theoretical_earliestOperationStartTime = start.getTheoreticalEarliestOperationStartTime(); theoretical_latestOperationStartTime = start.getTheoreticalLatestOperationStartTime(); endTime = start.getEndTime(); setIndex(-1); }
private DeliverShipment(DeliverShipment deliveryShipmentActivity) { this.shipment = (Shipment) deliveryShipmentActivity.getJob(); this.arrTime = deliveryShipmentActivity.getArrTime(); this.endTime = deliveryShipmentActivity.getEndTime(); this.capacity = deliveryShipmentActivity.getSize(); setIndex(deliveryShipmentActivity.getIndex()); this.earliest = deliveryShipmentActivity.getTheoreticalEarliestOperationStartTime(); this.latest = deliveryShipmentActivity.getTheoreticalLatestOperationStartTime(); }
private DeliverService(DeliverService deliveryActivity) { this.delivery = deliveryActivity.getJob(); this.arrTime = deliveryActivity.getArrTime(); this.endTime = deliveryActivity.getEndTime(); capacity = deliveryActivity.getSize(); setIndex(deliveryActivity.getIndex()); this.theoreticalEarliest = deliveryActivity.getTheoreticalEarliestOperationStartTime(); this.theoreticalLatest = deliveryActivity.getTheoreticalLatestOperationStartTime(); }
protected ServiceActivity(ServiceActivity serviceActivity) { this.service = serviceActivity.getJob(); this.arrTime = serviceActivity.getArrTime(); this.endTime = serviceActivity.getEndTime(); setIndex(serviceActivity.getIndex()); this.theoreticalEarliest = serviceActivity.getTheoreticalEarliestOperationStartTime(); this.theoreticalLatest = serviceActivity.getTheoreticalLatestOperationStartTime(); }
private PickupShipment(PickupShipment pickupShipmentActivity) { this.shipment = (Shipment) pickupShipmentActivity.getJob(); this.arrTime = pickupShipmentActivity.getArrTime(); this.endTime = pickupShipmentActivity.getEndTime(); setIndex(pickupShipmentActivity.getIndex()); this.earliest = pickupShipmentActivity.getTheoreticalEarliestOperationStartTime(); this.latest = pickupShipmentActivity.getTheoreticalLatestOperationStartTime(); }
@Override public String toString() { return "[type=" + getName() + "][location=" + getLocation() + "][size=" + getSize().toString() + "][twStart=" + Activities.round(getTheoreticalEarliestOperationStartTime()) + "][twEnd=" + Activities.round(getTheoreticalLatestOperationStartTime()) + "]"; }
private Builder(Vehicle vehicle, Driver driver) { super(); this.vehicle = vehicle; this.driver = driver; start = new Start(vehicle.getStartLocation(), vehicle.getEarliestDeparture(), Double.MAX_VALUE); start.setEndTime(vehicle.getEarliestDeparture()); end = new End(vehicle.getEndLocation(), 0.0, vehicle.getLatestArrival()); }
/** * Copy constructor copying a route. * * @param route to copy */ private VehicleRoute(VehicleRoute route) { this.start = Start.copyOf(route.getStart()); this.end = End.copyOf(route.getEnd()); this.tourActivities = TourActivities.copyOf(route.getTourActivities()); this.vehicle = route.getVehicle(); this.driver = route.getDriver(); }
public Iterator<TourActivity> reverseActivityIterator() { if (backward == null) backward = new ReverseActivityIterator(tourActivities); else backward.reset(); return backward; }
/** * Returns new instance of TimeWindow. * * @param start * @param end * @return TimeWindow * @throw IllegalArgumentException either if start or end < 0.0 or end < start */ public static TimeWindow newInstance(double start, double end) { return new TimeWindow(start, end); }
private void begin(VehicleRoute route) { for (ActivityVisitor visitor : visitors) { visitor.begin(route); } }
private void visit(TourActivity act) { for (ActivityVisitor visitor : visitors) { visitor.visit(act); } }
private void finish(VehicleRoute route) { for (ReverseActivityVisitor visitor : visitors) { visitor.finish(); } }
private void visit(TourActivity act) { for (ReverseActivityVisitor visitor : visitors) { visitor.visit(act); } }
public Start(Location location, double theoreticalStart, double theoreticalEnd) { super(); this.location = location; this.theoretical_earliestOperationStartTime = theoreticalStart; this.theoretical_latestOperationStartTime = theoreticalEnd; this.endTime = theoreticalStart; setIndex(-1); }