Class Shipment

java.lang.Object
com.graphhopper.jsprit.core.problem.AbstractJob
com.graphhopper.jsprit.core.problem.job.Shipment
All Implemented Interfaces:
HasId, HasIndex, Job

public class Shipment extends AbstractJob
Shipment is an implementation of Job and consists of a pickup and a delivery of something.

It distinguishes itself from Service as two locations are involved a pickup where usually something is loaded to the transport unit and a delivery where something is unloaded.

By default serviceTimes of both pickup and delivery is 0.0 and timeWindows of both is [0.0, Double.MAX_VALUE],

A shipment can be built with a builder. You can get an instance of the builder by coding Shipment.Builder.newInstance(...). This way you can specify the shipment. Once you build the shipment, it is immutable, i.e. fields/attributes cannot be changed anymore and you can only 'get' the specified values.

Note that two shipments are equal if they have the same id.

Author:
schroeder
  • Method Details

    • getId

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

      public Location getPickupLocation()
    • getPickupServiceTime

      public double getPickupServiceTime()
      Returns the pickup service-time.

      By default service-time is 0.0.

      Returns:
      service-time
    • getDeliveryLocation

      public Location getDeliveryLocation()
    • getDeliveryServiceTime

      public double getDeliveryServiceTime()
      Returns service-time of delivery.
      Returns:
      service-time of delivery
    • getDeliveryTimeWindow

      public TimeWindow getDeliveryTimeWindow()
      Returns the time-window of delivery.
      Returns:
      time-window of delivery
    • getDeliveryTimeWindows

      public Collection<TimeWindow> getDeliveryTimeWindows()
    • getPickupTimeWindow

      public TimeWindow getPickupTimeWindow()
      Returns the time-window of pickup.
      Returns:
      time-window of pickup
    • getPickupTimeWindows

      public Collection<TimeWindow> getPickupTimeWindows()
    • toString

      public String toString()
      Returns a string with the shipment'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 shipments are equal if they have the same id.
      Overrides:
      equals in class Object
      Returns:
      true if shipments are equal (have the same id)
    • 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 shipment. Only 1 (high) to 10 (low) are allowed.

      Default is 2.

      Returns:
      priority
    • getMaxTimeInVehicle

      public double getMaxTimeInVehicle()
    • getActivities

      public List<Activity> getActivities()
    • getJobType

      public Job.Type getJobType()