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 candidate
candidateSolution - the candidate after repair and optional local search, including when rejected
status - the outcome assigned by the solver
isRewardEligible - whether the configured outcome score may be applied; if false, 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 Details

    • OperatorSelectionFeedback

      public OperatorSelectionFeedback(OperatorSelection operatorSelection, S candidateSolution, SolutionStatus status)
      Creates feedback eligible for the configured outcome score.
      Parameters:
      operatorSelection - the selected operator pair
      candidateSolution - the candidate after repair and optional local search
      status - the outcome assigned by the solver
    • OperatorSelectionFeedback

      public OperatorSelectionFeedback(OperatorSelection operatorSelection, S candidateSolution, SolutionStatus status, boolean isRewardEligible)
      Creates an instance of a OperatorSelectionFeedback record class.
      Parameters:
      operatorSelection - the value for the operatorSelection record component
      candidateSolution - the value for the candidateSolution record component
      status - the value for the status record component
      isRewardEligible - the value for the isRewardEligible record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • operatorSelection

      public OperatorSelection operatorSelection()
      Returns the value of the operatorSelection record component.
      Returns:
      the value of the operatorSelection record component
    • candidateSolution

      public S candidateSolution()
      Returns the value of the candidateSolution record component.
      Returns:
      the value of the candidateSolution record component
    • status

      public SolutionStatus status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • isRewardEligible

      public boolean isRewardEligible()
      Returns the value of the isRewardEligible record component.
      Returns:
      the value of the isRewardEligible record component