Class VehicleRoute.Builder
- Enclosing class:
VehicleRoute
- Author:
- stefan
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.addBreak(Break currentbreak, TimeWindow timeWindow) Deprecated.addBreak(Break currentbreak, TimeWindow timeWindow, Location location) addDelivery(Delivery delivery) Adds a delivery to this route.addDelivery(Delivery delivery, TimeWindow timeWindow) addDelivery(Shipment shipment) Adds a the delivery of the specified shipment.addDelivery(Shipment shipment, TimeWindow deliveryTimeWindow) Adds a pickup to this route.addPickup(Pickup pickup, TimeWindow timeWindow) Adds a the pickup of the specified shipment.addPickup(Shipment shipment, TimeWindow pickupTimeWindow) addService(Service service) Adds a service to this route.addService(Service service, TimeWindow timeWindow) build()Builds the route.static VehicleRoute.BuildernewInstance(Vehicle vehicle) Returns new instance of this builder.static VehicleRoute.BuildernewInstance(Vehicle vehicle, Driver driver) Returns new instance of this builder.setDepartureTime(double departureTime) Sets the departure-time of the route, i.e.setJobActivityFactory(JobActivityFactory jobActivityFactory)
-
Method Details
-
newInstance
Returns new instance of this builder.Construction-settings of vehicleRoute:
startLocation == vehicle.getStartLocationId()
endLocation == vehicle.getEndLocationId()
departureTime == vehicle.getEarliestDepartureTime()
latestStart == Double.MAX_VALUE
earliestEnd == 0.0
- Parameters:
vehicle- employed vehicledriver- employed driver- Returns:
- this builder
-
newInstance
Returns new instance of this builder.Construction-settings of vehicleRoute:
startLocation == vehicle.getStartLocationId()
endLocation == vehicle.getEndLocationId()
departureTime == vehicle.getEarliestDepartureTime()
latestStart == Double.MAX_VALUE
earliestEnd == 0.0
- Parameters:
vehicle- employed vehicle- Returns:
- this builder
-
setJobActivityFactory
-
setDepartureTime
Sets the departure-time of the route, i.e. which is the time the vehicle departs from start-location.Note that departureTime cannot be lower than earliestDepartureTime of vehicle.
- Parameters:
departureTime- departure time of vehicle being employed for this route- Returns:
- builder
- Throws:
IllegalArgumentException- if departureTime invalid input: '<' vehicle.getEarliestDeparture()
-
addService
Adds a service to this route. Activity is initialized with .getTimeWindow(). If you want to explicitly set another time window use .addService(Service service, TimeWindow timeWindow)This implies that for this service a serviceActivity is created with
TourActivityFactoryand added to the sequence of tourActivities.The resulting activity occurs in the activity-sequence in the order adding/inserting.
- Parameters:
service- to be added- Returns:
- this builder
- Throws:
IllegalArgumentException- if service is null
-
addService
-
addBreak
Deprecated. -
addBreak
Deprecated. -
addBreak
-
addPickup
Adds a pickup to this route.- Parameters:
pickup- pickup to be added- Returns:
- the builder
-
addPickup
-
addDelivery
Adds a delivery to this route.- Parameters:
delivery- delivery to be added- Returns:
- the builder
-
addDelivery
-
addPickup
Adds a the pickup of the specified shipment.- Parameters:
shipment- to be picked up and added to this route- Returns:
- the builder
- Throws:
IllegalArgumentException- if method has already been called with the specified shipment.
-
addPickup
-
addDelivery
Adds a the delivery of the specified shipment.- Parameters:
shipment- to be delivered and add to this vehicleRoute- Returns:
- builder
- Throws:
IllegalArgumentException- if specified shipment has not been picked up yet (i.e. method addPickup(shipment) has not been called yet).
-
addDelivery
-
build
Builds the route.- Returns:
VehicleRoute- Throws:
IllegalArgumentException- if there are still shipments that have been picked up though but not delivery.
-