public static class Service.Builder<T extends Service> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Capacity |
capacity |
protected Capacity.Builder |
capacityBuilder |
protected Coordinate |
coord |
protected Location |
location |
protected String |
locationId |
protected double |
serviceTime |
protected Skills.Builder |
skillBuilder |
protected Skills |
skills |
protected TimeWindow |
timeWindow |
protected TimeWindowsImpl |
timeWindows |
| Modifier and Type | Method and Description |
|---|---|
Service.Builder<T> |
addAllRequiredSkills(Skills skills) |
Service.Builder<T> |
addAllSizeDimensions(Capacity size) |
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> |
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.
|
protected String locationId
protected Coordinate coord
protected double serviceTime
protected TimeWindow timeWindow
protected Capacity.Builder capacityBuilder
protected Capacity capacity
protected Skills.Builder skillBuilder
protected Skills skills
protected Location location
protected TimeWindowsImpl timeWindows
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> 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 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(Skills skills)
public Service.Builder<T> addAllSizeDimensions(Capacity size)
public Service.Builder<T> setPriority(int priority)
Default is 2 = medium.
priority - Copyright © 2013–2016. All rights reserved.