Class Shipment.Builder
java.lang.Object
com.graphhopper.jsprit.core.problem.job.Shipment.Builder
- Enclosing class:
Shipment
Builder that builds the shipment.
- Author:
- schroeder
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaddAllDeliveryTimeWindows(Collection<TimeWindow> timeWindow) addAllPickupTimeWindows(Collection<TimeWindow> timeWindow) addAllRequiredSkills(Skills skills) addAllRequiredSkills(Collection<String> skills) addAllSizeDimensions(Capacity size) addDeliveryTimeWindow(double earliest, double latest) addDeliveryTimeWindow(TimeWindow timeWindow) addPickupTimeWindow(double earliest, double latest) addPickupTimeWindow(TimeWindow timeWindow) addRequiredSkill(String skill) addSizeDimension(int dimensionIndex, int dimensionValue) Adds capacity dimension.build()Builds the shipment.static Shipment.BuildernewInstance(String id) Returns new instance of this builder.setDeliveryLocation(Location deliveryLocation) Sets delivery location.setDeliveryServiceTime(double deliveryServiceTime) Sets the delivery service-time.setDeliveryTimeWindow(TimeWindow timeWindow) Sets the timeWindow for the delivery, i.e.setMaxTimeInVehicle(double maxTimeInVehicle) Sets maximal time the job can be in vehicle.setPickupLocation(Location pickupLocation) Sets pickup location.setPickupServiceTime(double serviceTime) Sets pickupServiceTime.setPickupTimeWindow(TimeWindow timeWindow) Sets the timeWindow for the pickup, i.e.setPriority(int priority) Set priority to shipment.setUserData(Object userData) Sets user specific domain data associated with the object.
-
Field Details
-
deliveryTimeWindows
-
userData
-
maxTimeInVehicle
public double maxTimeInVehicle
-
-
Method Details
-
newInstance
Returns new instance of this builder.- Parameters:
id- the id of the shipment which must be a unique identifier among all jobs- Returns:
- the builder
-
setUserData
Sets user specific domain data associated with the object.The user data is a black box for the framework, it only stores it, but never interacts with it in any way.
- Parameters:
userData- any object holding the domain specific user data associated with the object.- Returns:
- builder
-
setPickupLocation
Sets pickup location.- Parameters:
pickupLocation- pickup location- Returns:
- builder
-
setPickupServiceTime
Sets pickupServiceTime.ServiceTime is intended to be the time the implied activity takes at the pickup-location.
- Parameters:
serviceTime- the service time / duration the pickup of the associated shipment takes- Returns:
- builder
- Throws:
IllegalArgumentException- if servicTime invalid input: '<' 0.0
-
setPickupTimeWindow
Sets the timeWindow for the pickup, i.e. the time-period in which a pickup operation is allowed to START.By default timeWindow is [0.0, Double.MAX_VALUE}
- Parameters:
timeWindow- the time window within the pickup operation/activity can START- Returns:
- builder
- Throws:
IllegalArgumentException- if timeWindow is null
-
setDeliveryLocation
Sets delivery location.- Parameters:
deliveryLocation- delivery location- Returns:
- builder
-
setDeliveryServiceTime
Sets the delivery service-time.ServiceTime is intended to be the time the implied activity takes at the delivery-location.
- Parameters:
deliveryServiceTime- the service time / duration of shipment's delivery- Returns:
- builder
- Throws:
IllegalArgumentException- if serviceTime invalid input: '<' 0.0
-
setDeliveryTimeWindow
Sets the timeWindow for the delivery, i.e. the time-period in which a delivery operation is allowed to start.By default timeWindow is [0.0, Double.MAX_VALUE}
- Parameters:
timeWindow- the time window within the associated delivery is allowed to START- Returns:
- builder
- Throws:
IllegalArgumentException- if timeWindow is null
-
addSizeDimension
Adds capacity dimension.- Parameters:
dimensionIndex- the dimension index of the corresponding capacity valuedimensionValue- the capacity value- Returns:
- builder
- Throws:
IllegalArgumentException- if dimVal invalid input: '<' 0
-
addAllSizeDimensions
-
build
Builds the shipment.- Returns:
- shipment
- Throws:
IllegalArgumentException- if neither pickup-location nor pickup-coord is set or if neither delivery-location nor delivery-coord is set
-
addRequiredSkill
-
addAllRequiredSkills
-
addAllRequiredSkills
-
setName
-
addDeliveryTimeWindow
-
addDeliveryTimeWindow
-
addAllDeliveryTimeWindows
-
addPickupTimeWindow
-
addPickupTimeWindow
-
addAllPickupTimeWindows
-
setPriority
Set priority to shipment. Only 1 (high) to 10 (low) are allowed.Default is 2.
- Parameters:
priority-- Returns:
- builder
-
setMaxTimeInVehicle
Sets maximal time the job can be in vehicle.- Parameters:
maxTimeInVehicle-- Returns:
-