java.lang.Object
com.graphhopper.jsprit.core.problem.AbstractJob
com.graphhopper.jsprit.core.problem.job.Service
All Implemented Interfaces:
HasId, HasIndex, Job
Direct Known Subclasses:
Break, Delivery, EnRouteDelivery, EnRoutePickup, Pickup

public class Service extends AbstractJob
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
  • Method Details

    • getTimeWindows

      public Collection<TimeWindow> getTimeWindows()
    • getId

      public String getId()
      Description copied from interface: Job
      Returns the unique identifier (id) of a job.
      Returns:
      id
    • getLocation

      public Location getLocation()
      Returns location.
      Returns:
      location
    • getServiceDuration

      public double getServiceDuration()
      Returns the service-time/duration a service takes at service-location.
      Returns:
      service duration
    • getTimeWindow

      public TimeWindow 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

      public String getType()
      Returns:
      the name
    • getJobType

      public Job.Type getJobType()
    • toString

      public String toString()
      Returns a string with the service's attributes.

      String is built as follows: [attr1=val1][attr2=val2]...

      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Two services are equal if they have the same id.
      Overrides:
      equals in class Object
    • getSize

      public Capacity getSize()
      Description copied from interface: Job
      Returns size, i.e. capacity-demand, of this job which can consist of an arbitrary number of capacity dimensions.
      Returns:
      Capacity
    • getRequiredSkills

      public Skills getRequiredSkills()
    • getName

      public String getName()
      Description copied from interface: Job
      Returns 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

      public List<Activity> getActivities()