Record Class OperatorSelectionFeedback<S extends Solution<S>>
java.lang.Object
java.lang.Record
io.github.nhtc2005.alns.selection.OperatorSelectionFeedback<S>
- Type Parameters:
S- the solution type- Record Components:
operatorSelection- the operator pair that produced the candidatecandidateSolution- the candidate after repair and optional local search, including when rejectedstatus- the outcome assigned by the solverisRewardEligible- whether the configured outcome score may be applied; iffalse, the built-in adaptive selectors apply the rejected-outcome score instead
public record OperatorSelectionFeedback<S extends Solution<S>>(OperatorSelection operatorSelection, S extends Solution<S> candidateSolution, SolutionStatus status, boolean isRewardEligible)
extends Record
Reports a candidate's outcome to the operator selector.
Reward eligibility affects scoring, not acceptance or status. The candidate is a shared reference and must not be modified by the selector.
-
Constructor Summary
ConstructorsConstructorDescriptionOperatorSelectionFeedback(OperatorSelection operatorSelection, S candidateSolution, SolutionStatus status) Creates feedback eligible for the configured outcome score.OperatorSelectionFeedback(OperatorSelection operatorSelection, S candidateSolution, SolutionStatus status, boolean isRewardEligible) Creates an instance of aOperatorSelectionFeedbackrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecandidateSolutionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisRewardEligiblerecord component.Returns the value of theoperatorSelectionrecord component.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
OperatorSelectionFeedback
public OperatorSelectionFeedback(OperatorSelection operatorSelection, S candidateSolution, SolutionStatus status) Creates feedback eligible for the configured outcome score.- Parameters:
operatorSelection- the selected operator paircandidateSolution- the candidate after repair and optional local searchstatus- the outcome assigned by the solver
-
OperatorSelectionFeedback
public OperatorSelectionFeedback(OperatorSelection operatorSelection, S candidateSolution, SolutionStatus status, boolean isRewardEligible) Creates an instance of aOperatorSelectionFeedbackrecord class.- Parameters:
operatorSelection- the value for theoperatorSelectionrecord componentcandidateSolution- the value for thecandidateSolutionrecord componentstatus- the value for thestatusrecord componentisRewardEligible- the value for theisRewardEligiblerecord 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 '=='. -
operatorSelection
Returns the value of theoperatorSelectionrecord component.- Returns:
- the value of the
operatorSelectionrecord component
-
candidateSolution
Returns the value of thecandidateSolutionrecord component.- Returns:
- the value of the
candidateSolutionrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
isRewardEligible
public boolean isRewardEligible()Returns the value of theisRewardEligiblerecord component.- Returns:
- the value of the
isRewardEligiblerecord component
-