Record Class JobInserted
java.lang.Object
java.lang.Record
com.graphhopper.jsprit.core.algorithm.listener.events.JobInserted
- Record Components:
iteration- The iteration numbertimestamp- When the event occurredjob- The job that was insertedrouteId- The ID of the vehicle/route the job was inserted intoposition- The position in the route where the job was insertedinsertionCost- The total insertion costcostBreakdown- The breakdown of insertion costs by component (may be null)insertionOrder- The order in which this job was inserted (1-based)
- All Implemented Interfaces:
AlgorithmEvent
public record JobInserted(int iteration, long timestamp, Job job, String routeId, int position, double insertionCost, InsertionCostBreakdown costBreakdown, int insertionOrder)
extends Record
implements AlgorithmEvent
Event emitted when a job is successfully inserted into a route.
-
Constructor Summary
ConstructorsConstructorDescriptionJobInserted(int iteration, long timestamp, Job job, String routeId, int position, double insertionCost, InsertionCostBreakdown costBreakdown, int insertionOrder) Creates an instance of aJobInsertedrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecostBreakdownrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleReturns the value of theinsertionCostrecord component.intReturns the value of theinsertionOrderrecord component.intReturns the value of theiterationrecord component.job()Returns the value of thejobrecord component.intposition()Returns the value of thepositionrecord component.routeId()Returns the value of therouteIdrecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
JobInserted
public JobInserted(int iteration, long timestamp, Job job, String routeId, int position, double insertionCost, InsertionCostBreakdown costBreakdown, int insertionOrder) Creates an instance of aJobInsertedrecord class.- Parameters:
iteration- the value for theiterationrecord componenttimestamp- the value for thetimestamprecord componentjob- the value for thejobrecord componentrouteId- the value for therouteIdrecord componentposition- the value for thepositionrecord componentinsertionCost- the value for theinsertionCostrecord componentcostBreakdown- the value for thecostBreakdownrecord componentinsertionOrder- the value for theinsertionOrderrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
iteration
public int iteration()Returns the value of theiterationrecord component.- Specified by:
iterationin interfaceAlgorithmEvent- Returns:
- the value of the
iterationrecord component
-
timestamp
public long timestamp()Returns the value of thetimestamprecord component.- Specified by:
timestampin interfaceAlgorithmEvent- Returns:
- the value of the
timestamprecord component
-
job
Returns the value of thejobrecord component.- Returns:
- the value of the
jobrecord component
-
routeId
Returns the value of therouteIdrecord component.- Returns:
- the value of the
routeIdrecord component
-
position
public int position()Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-
insertionCost
public double insertionCost()Returns the value of theinsertionCostrecord component.- Returns:
- the value of the
insertionCostrecord component
-
costBreakdown
Returns the value of thecostBreakdownrecord component.- Returns:
- the value of the
costBreakdownrecord component
-
insertionOrder
public int insertionOrder()Returns the value of theinsertionOrderrecord component.- Returns:
- the value of the
insertionOrderrecord component
-