Record Class ChoiceAnswer
java.lang.Object
java.lang.Record
ai.redouble.nucleo.harness.decision.ChoiceAnswer
- Record Components:
choice- the winning option key, one of the keys askedprobabilities- a probability per option key asked, in the order askedconfidence- the endpoint's concentration figure for the distribution, 0 to 1
- All Implemented Interfaces:
Answer
public record ChoiceAnswer(String choice, Map<String,Double> probabilities, double confidence)
extends Record
implements Answer
The answer to a
Choice: the option that won, the probability of every option in the
order they were asked, and a confidence, which is arithmetic on that distribution (how far
the winner stands above a uniform spread) and not a second estimate of being right.- Since:
- 0.1 (2026-09-24)
- Author:
- Andrey Santrosyan
-
Constructor Summary
ConstructorsConstructorDescriptionChoiceAnswer(String choice, Map<String, Double> probabilities, double confidence) Creates an instance of aChoiceAnswerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionchoice()Returns the value of thechoicerecord component.doubleReturns the value of theconfidencerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theprobabilitiesrecord component.doubleThe probability of the winning option.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ChoiceAnswer
Creates an instance of aChoiceAnswerrecord class.- Parameters:
choice- the value for thechoicerecord componentprobabilities- the value for theprobabilitiesrecord componentconfidence- the value for theconfidencerecord component
-
-
Method Details
-
probability
public double probability()The probability of the winning option. -
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
choice
-
probabilities
Returns the value of theprobabilitiesrecord component.- Returns:
- the value of the
probabilitiesrecord component
-
confidence
public double confidence()Returns the value of theconfidencerecord component.- Returns:
- the value of the
confidencerecord component
-