/** * Sets the departure-time of the route, i.e. which is the time the vehicle departs from start-location. * <p> * <p><b>Note</b> that departureTime cannot be lower than earliestDepartureTime of vehicle. * * @param departureTime departure time of vehicle being employed for this route * @return builder * @throws IllegalArgumentException if departureTime < vehicle.getEarliestDeparture() */ public Builder setDepartureTime(double departureTime) { if (departureTime < start.getEndTime()) throw new IllegalArgumentException("departureTime < vehicle.getEarliestDepartureTime(). this must not be."); start.setEndTime(departureTime); return this; }
@Override public void begin(VehicleRoute route) { timeTracker.begin(route); this.route = route; route.getStart().setEndTime(timeTracker.getActEndTime()); }
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()); }
private void initialiseStartAndEnd(final Vehicle newVehicle, double newVehicleDepartureTime) { if (start == null) { start = new Start(newVehicle.getStartLocation(), newVehicle.getEarliestDeparture(), Double.MAX_VALUE); start.setEndTime(newVehicleDepartureTime); } else { start.setLocation(Location.newInstance(newVehicle.getStartLocation().getId())); start.setTheoreticalEarliestOperationStartTime(newVehicle.getEarliestDeparture()); start.setTheoreticalLatestOperationStartTime(Double.MAX_VALUE); start.setEndTime(newVehicleDepartureTime); } if (end == null) { end = new End(newVehicle.getEndLocation(), 0.0, newVehicle.getLatestArrival()); } else { end.setLocation(Location.newInstance(newVehicle.getEndLocation().getId())); end.setTheoreticalEarliestOperationStartTime(0.0); end.setTheoreticalLatestOperationStartTime(newVehicle.getLatestArrival()); } }
start.setEndTime(newVehicleDepartureTime); End end = new End(newVehicle.getEndLocation(), 0.0, newVehicle.getLatestArrival());
private void setStartAndEnd(Vehicle vehicle, double vehicleDepTime) { if (!(vehicle instanceof VehicleImpl.NoVehicle)) { if (start == null && end == null) { start = new Start(vehicle.getStartLocation(), vehicle.getEarliestDeparture(), vehicle.getLatestArrival()); end = new End(vehicle.getEndLocation(), vehicle.getEarliestDeparture(), vehicle.getLatestArrival()); } start.setEndTime(Math.max(vehicleDepTime, vehicle.getEarliestDeparture())); start.setTheoreticalEarliestOperationStartTime(vehicle.getEarliestDeparture()); start.setTheoreticalLatestOperationStartTime(vehicle.getLatestArrival()); start.setLocation(vehicle.getStartLocation()); end.setLocation(vehicle.getEndLocation()); end.setTheoreticalEarliestOperationStartTime(vehicle.getEarliestDeparture()); end.setTheoreticalLatestOperationStartTime(vehicle.getLatestArrival()); } }
start.setEndTime(newVehicleDepartureTime); End end = new End(newVehicle.getEndLocation(), 0.0, newVehicle.getLatestArrival());
start.setEndTime(newVehicleDepartureTime);
start.setEndTime(newVehicleDepartureTime); End end = new End(newVehicle.getEndLocation(), 0.0, newVehicle.getLatestArrival()); ActivityContext pickupContext = new ActivityContext();
/** * Sets the departure-time of the route, i.e. which is the time the vehicle departs from start-location. * <p> * <p><b>Note</b> that departureTime cannot be lower than earliestDepartureTime of vehicle. * * @param departureTime departure time of vehicle being employed for this route * @return builder * @throws IllegalArgumentException if departureTime < vehicle.getEarliestDeparture() */ public Builder setDepartureTime(double departureTime) { if (departureTime < start.getEndTime()) throw new IllegalArgumentException("departureTime < vehicle.getEarliestDepartureTime(). this must not be."); start.setEndTime(departureTime); return this; }
@Override public void begin(VehicleRoute route) { timeTracker.begin(route); this.route = route; route.getStart().setEndTime(timeTracker.getActEndTime()); }
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()); }
private void initialiseStartAndEnd(final Vehicle newVehicle, double newVehicleDepartureTime) { if (start == null) { start = new Start(newVehicle.getStartLocation(), newVehicle.getEarliestDeparture(), Double.MAX_VALUE); start.setEndTime(newVehicleDepartureTime); } else { start.setLocation(Location.newInstance(newVehicle.getStartLocation().getId())); start.setTheoreticalEarliestOperationStartTime(newVehicle.getEarliestDeparture()); start.setTheoreticalLatestOperationStartTime(Double.MAX_VALUE); start.setEndTime(newVehicleDepartureTime); } if (end == null) { end = new End(newVehicle.getEndLocation(), 0.0, newVehicle.getLatestArrival()); } else { end.setLocation(Location.newInstance(newVehicle.getEndLocation().getId())); end.setTheoreticalEarliestOperationStartTime(0.0); end.setTheoreticalLatestOperationStartTime(newVehicle.getLatestArrival()); } }
private void setStartAndEnd(Vehicle vehicle, double vehicleDepTime) { if (!(vehicle instanceof VehicleImpl.NoVehicle)) { if (start == null && end == null) { start = new Start(vehicle.getStartLocation(), vehicle.getEarliestDeparture(), vehicle.getLatestArrival()); end = new End(vehicle.getEndLocation(), vehicle.getEarliestDeparture(), vehicle.getLatestArrival()); } start.setEndTime(Math.max(vehicleDepTime, vehicle.getEarliestDeparture())); start.setTheoreticalEarliestOperationStartTime(vehicle.getEarliestDeparture()); start.setTheoreticalLatestOperationStartTime(vehicle.getLatestArrival()); start.setLocation(vehicle.getStartLocation()); end.setLocation(vehicle.getEndLocation()); end.setTheoreticalEarliestOperationStartTime(vehicle.getEarliestDeparture()); end.setTheoreticalLatestOperationStartTime(vehicle.getLatestArrival()); } }
start.setEndTime(newVehicleDepartureTime); End end = new End(newVehicle.getEndLocation(), 0.0, newVehicle.getLatestArrival());
start.setEndTime(newVehicleDepartureTime); End end = new End(newVehicle.getEndLocation(), 0.0, newVehicle.getLatestArrival());
start.setEndTime(newVehicleDepartureTime);