Class Shipment
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
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleanTwo shipments are equal if they have the same id.doubleReturns service-time of delivery.Returns the time-window of delivery.getId()Returns the unique identifier (id) of a job.doublegetName()Returns name.doubleReturns the pickup service-time.Returns the time-window of pickup.intGet priority of shipment.getSize()Returns size, i.e.inthashCode()toString()Returns a string with the shipment'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
-
getId
Description copied from interface:JobReturns the unique identifier (id) of a job.- Returns:
- id
-
getPickupLocation
-
getPickupServiceTime
public double getPickupServiceTime()Returns the pickup service-time.By default service-time is 0.0.
- Returns:
- service-time
-
getDeliveryLocation
-
getDeliveryServiceTime
public double getDeliveryServiceTime()Returns service-time of delivery.- Returns:
- service-time of delivery
-
getDeliveryTimeWindow
Returns the time-window of delivery.- Returns:
- time-window of delivery
-
getDeliveryTimeWindows
-
getPickupTimeWindow
Returns the time-window of pickup.- Returns:
- time-window of pickup
-
getPickupTimeWindows
-
toString
Returns a string with the shipment's attributes.String is built as follows: [attr1=val1][attr2=val2]...
-
hashCode
public int hashCode() -
equals
Two shipments 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 shipment. Only 1 (high) to 10 (low) are allowed.Default is 2.
- Returns:
- priority
-
getMaxTimeInVehicle
public double getMaxTimeInVehicle() -
getActivities
-
getJobType
-