Package com.tnsai.coordination.judge
Record Class JudgeCoordinator.Result<T>
java.lang.Object
java.lang.Record
com.tnsai.coordination.judge.JudgeCoordinator.Result<T>
- Type Parameters:
T- output type- Record Components:
output- the best output produced (null if all iterations failed)finalVerdict- the last verdict issuedverdictHistory- all verdicts from every iterationiterations- total iterations executedduration- total execution time
- Enclosing class:
JudgeCoordinator<T>
public static record JudgeCoordinator.Result<T>(T output, JudgeVerdict finalVerdict, List<JudgeVerdict> verdictHistory, int iterations, Duration duration)
extends Record
Result of a judged coordination cycle.
-
Constructor Summary
ConstructorsConstructorDescriptionResult(T output, JudgeVerdict finalVerdict, List<JudgeVerdict> verdictHistory, int iterations, Duration duration) Creates an instance of aResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionduration()Returns the value of thedurationrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefinalVerdictrecord component.final inthashCode()Returns a hash code value for this object.booleanWhether the final verdict approved the output.intReturns the value of theiterationsrecord component.output()Returns the value of theoutputrecord component.doublescore()Returns the final quality score.final StringtoString()Returns a string representation of this record class.Returns the value of theverdictHistoryrecord component.
-
Constructor Details
-
Result
public Result(T output, JudgeVerdict finalVerdict, List<JudgeVerdict> verdictHistory, int iterations, Duration duration) Creates an instance of aResultrecord class.- Parameters:
output- the value for theoutputrecord componentfinalVerdict- the value for thefinalVerdictrecord componentverdictHistory- the value for theverdictHistoryrecord componentiterations- the value for theiterationsrecord componentduration- the value for thedurationrecord component
-
-
Method Details
-
isApproved
public boolean isApproved()Whether the final verdict approved the output. -
score
public double score()Returns the final quality score. -
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 '=='. -
output
Returns the value of theoutputrecord component.- Returns:
- the value of the
outputrecord component
-
finalVerdict
Returns the value of thefinalVerdictrecord component.- Returns:
- the value of the
finalVerdictrecord component
-
verdictHistory
Returns the value of theverdictHistoryrecord component.- Returns:
- the value of the
verdictHistoryrecord component
-
iterations
public int iterations()Returns the value of theiterationsrecord component.- Returns:
- the value of the
iterationsrecord component
-
duration
Returns the value of thedurationrecord component.- Returns:
- the value of the
durationrecord component
-