Record Class InsertionEvaluated
java.lang.Object
java.lang.Record
com.graphhopper.jsprit.core.algorithm.listener.events.InsertionEvaluated
- Record Components:
iteration- The iteration numbertimestamp- When the event occurredjob- The job being insertedrouteId- The route being evaluated (vehicle ID)position- The insertion position in the routecost- The total insertion cost (Double.MAX_VALUE if infeasible)breakdown- The cost breakdown (null if infeasible)feasible- Whether the insertion is feasiblefailedConstraints- Names of constraints that failed (empty if feasible)chosen- Whether this insertion was chosen as the best
- All Implemented Interfaces:
AlgorithmEvent
public record InsertionEvaluated(int iteration, long timestamp, Job job, String routeId, int position, double cost, InsertionCostBreakdown breakdown, boolean feasible, List<String> failedConstraints, boolean chosen)
extends Record
implements AlgorithmEvent
Event emitted when an insertion is evaluated for a job.
This provides full transparency into the insertion decision, including cost breakdown and why certain routes were rejected.
-
Constructor Summary
ConstructorsConstructorDescriptionInsertionEvaluated(int iteration, long timestamp, Job job, String routeId, int position, double cost, InsertionCostBreakdown breakdown, boolean feasible, List<String> failedConstraints, boolean chosen) Creates an instance of aInsertionEvaluatedrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebreakdownrecord component.booleanchosen()Returns the value of thechosenrecord component.doublecost()Returns the value of thecostrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefailedConstraintsrecord component.booleanfeasible()Returns the value of thefeasiblerecord component.final inthashCode()Returns a hash code value for this object.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
-
InsertionEvaluated
public InsertionEvaluated(int iteration, long timestamp, Job job, String routeId, int position, double cost, InsertionCostBreakdown breakdown, boolean feasible, List<String> failedConstraints, boolean chosen) Creates an instance of aInsertionEvaluatedrecord 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 componentcost- the value for thecostrecord componentbreakdown- the value for thebreakdownrecord componentfeasible- the value for thefeasiblerecord componentfailedConstraints- the value for thefailedConstraintsrecord componentchosen- the value for thechosenrecord 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
-
cost
public double cost()Returns the value of thecostrecord component.- Returns:
- the value of the
costrecord component
-
breakdown
Returns the value of thebreakdownrecord component.- Returns:
- the value of the
breakdownrecord component
-
feasible
public boolean feasible()Returns the value of thefeasiblerecord component.- Returns:
- the value of the
feasiblerecord component
-
failedConstraints
Returns the value of thefailedConstraintsrecord component.- Returns:
- the value of the
failedConstraintsrecord component
-
chosen
public boolean chosen()Returns the value of thechosenrecord component.- Returns:
- the value of the
chosenrecord component
-