|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.ai.scorer.ScoreAndConf
public final class ScoreAndConf
Immutable (and Internable) return type from scorer method. Allowed values run from -MAX (bad) through 0 (neutral) to +MAX (good) for score, and from 0 (no confidence) to +MAX (full) for confidence.
Note that the score values are symmetrical about zero.
The low-ish precision of the elements is deliberate to reflect the fact that scoring is bound to be fairly imprecise and to save a little space.
| Field Summary | |
|---|---|
static java.util.Comparator<ScoreAndConf> |
ByConfidence
A static Comparator that sorts by confidence. |
static java.util.Comparator<ScoreAndConf> |
ByGoodness
A static Comparator that sorts by goodness. |
short |
confidence
Confidence: 0 (no confidence) to +MAX (full) for confidence. |
static short |
MAX
Maximum positive or negative value of any element; strictly positive. |
static int |
MAX_GOODNESS
Max (+ve) "goodness" value returned by computeScorerGoodness(); strictly positive. |
static ScoreAndConf |
NO_OPINION
All-zeros value used to mean "no idea" / "no opinion" when returned by a Scorer. |
short |
score
Score: -MAX (bad) through 0 (neutral) to +MAX (good). |
| Constructor Summary | |
|---|---|
ScoreAndConf(int score,
int confidence)
Construct an instance using int values; requires extra checking. |
|
ScoreAndConf(short score,
short confidence)
Construct an instance. |
|
| Method Summary | |
|---|---|
static int |
computeScorerGoodness(ScoreAndConf sac)
Compute Scorer "goodness" from its ScoreAndConfidence value. |
boolean |
equals(java.lang.Object obj)
Equality depends on all elements. |
static ScoreAndConf |
fromString(java.lang.String s)
Parse toString() representation to return ScoreAndConf value; never null. |
int |
hashCode()
The hash depends on all elements. |
java.lang.Boolean |
isGood()
Find out if this is notably good or bad using the same thresholds as for voting (etc) in the rest of the Gallery. |
java.lang.String |
toString()
Compute human-readable summary; never null. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final short MAX
public final short score
public final short confidence
public static final ScoreAndConf NO_OPINION
public static final int MAX_GOODNESS
public static final java.util.Comparator<ScoreAndConf> ByGoodness
public static final java.util.Comparator<ScoreAndConf> ByConfidence
| Constructor Detail |
|---|
public ScoreAndConf(short score,
short confidence)
public ScoreAndConf(int score,
int confidence)
| Method Detail |
|---|
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
This includes the scale (maximum) for non-zero values to allow for robust reconstruction in future versions.
toString in class java.lang.Objectpublic static ScoreAndConf fromString(java.lang.String s)
java.lang.IllegalArgumentException - if the input is unparsablepublic java.lang.Boolean isGood()
This is based on the product of score and confidence.
public static int computeScorerGoodness(ScoreAndConf sac)
This is a unitless relative value used to sort Scorers in the range [-MAX^2,+MAX^2] ie [-MAX_GOODNESS,+MAX_GOODNESS where -ve is "wrongheaded", 0 is "useless", and +ve is "good".
|
DHD Multimedia Gallery V1.60.69 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||