public static class Service.Builder<T extends Service> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Activity |
activity |
protected Capacity |
capacity |
protected Capacity.Builder |
capacityBuilder |
protected Coordinate |
coord |
protected Location |
location |
protected String |
locationId |
protected double |
maxTimeInVehicle |
protected double |
serviceTime |
protected Skills.Builder |
skillBuilder |
protected Skills |
skills |
protected TimeWindowsImpl |
timeWindows |
protected Object |
userData |
| Modifier and Type | Method and Description |
|---|---|
Service.Builder<T> |
addAllRequiredSkills(Collection<String> skills) |
Service.Builder<T> |
addAllRequiredSkills(Skills skills) |
Service.Builder<T> |
addAllSizeDimensions(Capacity size) |
Service.Builder<T> |
addAllTimeWindows(Collection<TimeWindow> timeWindows) |
Service.Builder<T> |
addRequiredSkill(String skill) |
Service.Builder<T> |
addSizeDimension(int dimensionIndex,
int dimensionValue)
Adds capacity dimension.
|
Service.Builder<T> |
addTimeWindow(double earliest,
double latest) |
Service.Builder<T> |
addTimeWindow(TimeWindow timeWindow) |
T |
build()
Builds the service.
|
static Service.Builder |
newInstance(String id)
Returns a new instance of builder that builds a service.
|
Service.Builder<T> |
setLocation(Location location)
Sets location
|
Service.Builder<T> |
setMaxTimeInVehicle(double maxTimeInVehicle) |
Service.Builder<T> |
setName(String name) |
Service.Builder<T> |
setPriority(int priority)
Set priority to service.
|
Service.Builder<T> |
setServiceTime(double serviceTime)
Sets the serviceTime of this service.
|
Service.Builder<T> |
setTimeWindow(TimeWindow tw) |
protected Service.Builder<T> |
setType(String name)
Protected method to set the type-name of the service.
|
Service.Builder<T> |
setUserData(Object userData)
Sets user specific domain data associated with the object.
|
protected String locationId
protected Coordinate coord
protected double serviceTime
protected Capacity.Builder capacityBuilder
protected Capacity capacity
protected Skills.Builder skillBuilder
protected Skills skills
protected Location location
protected TimeWindowsImpl timeWindows
protected Object userData
protected double maxTimeInVehicle
protected Activity activity
public static Service.Builder newInstance(String id)
id - the id of the serviceprotected Service.Builder<T> setType(String name)
name - the name of servicepublic Service.Builder<T> setLocation(Location location)
location - locationpublic Service.Builder<T> setServiceTime(double serviceTime)
It is understood as time that a service or its implied activity takes at the service-location, for instance to unload goods.
serviceTime - the service time / duration of service to be setIllegalArgumentException - if serviceTime < 0public Service.Builder<T> setUserData(Object userData)
The user data is a black box for the framework, it only stores it, but never interacts with it in any way.
userData - any object holding the domain specific user data
associated with the object.public Service.Builder<T> addSizeDimension(int dimensionIndex, int dimensionValue)
dimensionIndex - the dimension index of the capacity valuedimensionValue - the capacity valueIllegalArgumentException - if dimensionValue < 0public Service.Builder<T> setTimeWindow(TimeWindow tw)
public Service.Builder<T> addTimeWindow(TimeWindow timeWindow)
public Service.Builder<T> addTimeWindow(double earliest, double latest)
public Service.Builder<T> addAllTimeWindows(Collection<TimeWindow> timeWindows)
public T build()
ServiceIllegalArgumentException - if neither locationId nor coordinate is set.public Service.Builder<T> addRequiredSkill(String skill)
public Service.Builder<T> setName(String name)
public Service.Builder<T> addAllRequiredSkills(Collection<String> skills)
public Service.Builder<T> addAllRequiredSkills(Skills skills)
public Service.Builder<T> addAllSizeDimensions(Capacity size)
public Service.Builder<T> setPriority(int priority)
Default is 2.
priority - public Service.Builder<T> setMaxTimeInVehicle(double maxTimeInVehicle)
Copyright © 2013–2020. All rights reserved.