Class Service.Builder<T extends Service>
java.lang.Object
com.graphhopper.jsprit.core.problem.job.Service.Builder<T>
- Direct Known Subclasses:
Break.Builder,Delivery.Builder,EnRouteDelivery.Builder,EnRoutePickup.Builder,Pickup.Builder
- Enclosing class:
Service
Builder that builds a service.
- Author:
- schroeder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Activityprotected Capacityprotected Capacity.Builderprotected Coordinateprotected Locationprotected Stringprotected doubleprotected doubleprotected Skills.Builderprotected Skillsprotected TimeWindowsImplprotected Object -
Method Summary
Modifier and TypeMethodDescriptionaddAllRequiredSkills(Skills skills) addAllRequiredSkills(Collection<String> skills) addAllSizeDimensions(Capacity size) addAllTimeWindows(Collection<TimeWindow> timeWindows) addRequiredSkill(String skill) addSizeDimension(int dimensionIndex, int dimensionValue) Adds capacity dimension.addTimeWindow(double earliest, double latest) addTimeWindow(TimeWindow timeWindow) build()Builds the service.static Service.BuildernewInstance(String id) Returns a new instance of builder that builds a service.setLocation(Location location) Sets locationsetMaxTimeInVehicle(double maxTimeInVehicle) setPriority(int priority) Set priority to service.setServiceTime(double serviceTime) Sets the serviceTime of this service.protected Service.Builder<T> Protected method to set the type-name of the service.setUserData(Object userData) Sets user specific domain data associated with the object.
-
Field Details
-
locationId
-
coord
-
serviceTime
protected double serviceTime -
capacityBuilder
-
capacity
-
skillBuilder
-
skills
-
location
-
timeWindows
-
userData
-
maxTimeInVehicle
protected double maxTimeInVehicle -
activity
-
-
Method Details
-
newInstance
Returns a new instance of builder that builds a service.- Parameters:
id- the id of the service- Returns:
- the builder
-
setType
Protected method to set the type-name of the service.- Parameters:
name- the name of service- Returns:
- the builder
-
setLocation
Sets location- Parameters:
location- location- Returns:
- builder
-
setServiceTime
Sets the serviceTime of this service.It is understood as time that a service or its implied activity takes at the service-location, for instance to unload goods.
- Parameters:
serviceTime- the service time / duration of service to be set- Returns:
- builder
- Throws:
IllegalArgumentException- if serviceTime invalid input: '<' 0
-
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
-
addSizeDimension
Adds capacity dimension.- Parameters:
dimensionIndex- the dimension index of the capacity valuedimensionValue- the capacity value- Returns:
- the builder
- Throws:
IllegalArgumentException- if dimensionValue invalid input: '<' 0
-
setTimeWindow
-
addTimeWindow
-
addTimeWindow
-
addAllTimeWindows
-
build
Builds the service.- Returns:
Service- Throws:
IllegalArgumentException- if neither locationId nor coordinate is set.
-
addRequiredSkill
-
setName
-
addAllRequiredSkills
-
addAllRequiredSkills
-
addAllSizeDimensions
-
setPriority
Set priority to service. Only 1 (very high) to 10 (very low) are allowed.Default is 2.
- Parameters:
priority-- Returns:
- builder
-
setMaxTimeInVehicle
-