Class Service
java.lang.Object
com.graphhopper.jsprit.core.problem.AbstractJob
com.graphhopper.jsprit.core.problem.job.Service
- Direct Known Subclasses:
Break,Delivery,EnRouteDelivery,EnRoutePickup,Pickup
Service implementation of a job.
A service distinguishes itself from a shipment such that it has only one location. Thus a service is a single point in space (where a service-activity occurs).
Note that two services are equal if they have the same id.
- Author:
- schroeder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classService.Builder<T extends Service>Builder that builds a service. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTwo services are equal if they have the same id.getId()Returns the unique identifier (id) of a job.Returns location.doublegetName()Returns name.intGet priority of service.doubleReturns the service-time/duration a service takes at service-location.getSize()Returns size, i.e.Returns the time-window a service(-operation) is allowed to start.getType()inthashCode()toString()Returns a string with the service's attributes.Methods inherited from class com.graphhopper.jsprit.core.problem.AbstractJob
getIndex, getUserData, setIndex, setUserDataMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.graphhopper.jsprit.core.problem.job.Job
isDeliveredToVehicleEnd, isPickedUpAtVehicleStart
-
Method Details
-
getTimeWindows
-
getId
Description copied from interface:JobReturns the unique identifier (id) of a job.- Returns:
- id
-
getLocation
Returns location.- Returns:
- location
-
getServiceDuration
public double getServiceDuration()Returns the service-time/duration a service takes at service-location.- Returns:
- service duration
-
getTimeWindow
Returns the time-window a service(-operation) is allowed to start. It is recommended to use getTimeWindows() instead. If you still use this, it returns the first time window of getTimeWindows() collection.- Returns:
- time window
-
getType
- Returns:
- the name
-
getJobType
-
toString
Returns a string with the service's attributes.String is built as follows: [attr1=val1][attr2=val2]...
-
hashCode
public int hashCode() -
equals
Two services are equal if they have the same id. -
getSize
Description copied from interface:JobReturns size, i.e. capacity-demand, of this job which can consist of an arbitrary number of capacity dimensions.- Returns:
- Capacity
-
getRequiredSkills
-
getName
Description copied from interface:JobReturns name.- Returns:
- name
-
getPriority
public int getPriority()Get priority of service. Only 1 (high) to 10 (low) are allowed.Default is 2.
- Returns:
- priority
-
getMaxTimeInVehicle
public double getMaxTimeInVehicle() -
getActivities
-