Record Class IterationCompleted
java.lang.Object
java.lang.Record
com.graphhopper.jsprit.core.algorithm.listener.events.IterationCompleted
- Record Components:
iteration- The iteration number (1-based)timestamp- When the event occurrednewSolutionCost- The cost of the newly created solutionbestSolutionCost- The cost of the best solution so faraccepted- Whether the new solution was acceptedstrategyName- The name of the strategy used in this iteration
- All Implemented Interfaces:
AlgorithmEvent
public record IterationCompleted(int iteration, long timestamp, double newSolutionCost, double bestSolutionCost, boolean accepted, String strategyName)
extends Record
implements AlgorithmEvent
Event emitted when an iteration completes.
-
Constructor Summary
ConstructorsConstructorDescriptionIterationCompleted(int iteration, long timestamp, double newSolutionCost, double bestSolutionCost, boolean accepted, String strategyName) Creates an instance of aIterationCompletedrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepted()Returns the value of theacceptedrecord component.doubleReturns the value of thebestSolutionCostrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theiterationrecord component.doubleReturns the value of thenewSolutionCostrecord component.Returns the value of thestrategyNamerecord component.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
IterationCompleted
public IterationCompleted(int iteration, long timestamp, double newSolutionCost, double bestSolutionCost, boolean accepted, String strategyName) Creates an instance of aIterationCompletedrecord class.- Parameters:
iteration- the value for theiterationrecord componenttimestamp- the value for thetimestamprecord componentnewSolutionCost- the value for thenewSolutionCostrecord componentbestSolutionCost- the value for thebestSolutionCostrecord componentaccepted- the value for theacceptedrecord componentstrategyName- the value for thestrategyNamerecord 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
-
newSolutionCost
public double newSolutionCost()Returns the value of thenewSolutionCostrecord component.- Returns:
- the value of the
newSolutionCostrecord component
-
bestSolutionCost
public double bestSolutionCost()Returns the value of thebestSolutionCostrecord component.- Returns:
- the value of the
bestSolutionCostrecord component
-
accepted
public boolean accepted()Returns the value of theacceptedrecord component.- Returns:
- the value of the
acceptedrecord component
-
strategyName
Returns the value of thestrategyNamerecord component.- Returns:
- the value of the
strategyNamerecord component
-