public static class VehicleRoute.Builder extends Object
public static VehicleRoute.Builder newInstance(Vehicle vehicle, Driver driver)
Construction-settings of vehicleRoute:
startLocation == vehicle.getStartLocationId()
endLocation == vehicle.getEndLocationId()
departureTime == vehicle.getEarliestDepartureTime()
latestStart == Double.MAX_VALUE
earliestEnd == 0.0
vehicle - employed vehicledriver - employed driverpublic static VehicleRoute.Builder newInstance(Vehicle vehicle)
Construction-settings of vehicleRoute:
startLocation == vehicle.getStartLocationId()
endLocation == vehicle.getEndLocationId()
departureTime == vehicle.getEarliestDepartureTime()
latestStart == Double.MAX_VALUE
earliestEnd == 0.0
vehicle - employed vehiclepublic VehicleRoute.Builder setJobActivityFactory(JobActivityFactory jobActivityFactory)
public VehicleRoute.Builder setDepartureTime(double departureTime)
Note that departureTime cannot be lower than earliestDepartureTime of vehicle.
departureTime - departure time of vehicle being employed for this routeIllegalArgumentException - if departureTime < vehicle.getEarliestDeparture()public VehicleRoute.Builder addService(Service service)
This implies that for this service a serviceActivity is created with TourActivityFactory and added to the sequence of tourActivities.
The resulting activity occurs in the activity-sequence in the order adding/inserting.
service - to be addedIllegalArgumentException - if service is nullpublic VehicleRoute.Builder addService(Service service, TimeWindow timeWindow)
@Deprecated public VehicleRoute.Builder addBreak(Break currentbreak)
@Deprecated public VehicleRoute.Builder addBreak(Break currentbreak, TimeWindow timeWindow)
public VehicleRoute.Builder addBreak(Break currentbreak, TimeWindow timeWindow, Location location)
public VehicleRoute.Builder addPickup(Pickup pickup)
pickup - pickup to be addedpublic VehicleRoute.Builder addPickup(Pickup pickup, TimeWindow timeWindow)
public VehicleRoute.Builder addDelivery(Delivery delivery)
delivery - delivery to be addedpublic VehicleRoute.Builder addDelivery(Delivery delivery, TimeWindow timeWindow)
public VehicleRoute.Builder addPickup(Shipment shipment)
shipment - to be picked up and added to this routeIllegalArgumentException - if method has already been called with the specified shipment.public VehicleRoute.Builder addPickup(Shipment shipment, TimeWindow pickupTimeWindow)
public VehicleRoute.Builder addDelivery(Shipment shipment)
shipment - to be delivered and add to this vehicleRouteIllegalArgumentException - if specified shipment has not been picked up yet (i.e. method addPickup(shipment) has not been called yet).public VehicleRoute.Builder addDelivery(Shipment shipment, TimeWindow deliveryTimeWindow)
public VehicleRoute build()
VehicleRouteIllegalArgumentException - if there are still shipments that have been picked up though but not delivery.Copyright © 2013–2019. All rights reserved.