public class ScoreUtils extends Object
| Constructor and Description |
|---|
ScoreUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <A,B> ParamAndField<A,B> |
pickBest(FieldScoreProducer<A,B> producer,
A[] params,
Random random)
Pick a random best
FieldScore when scoring.NOTE: Because an underlying HashMap is used, to guarantee the same randomization, both the A and B classes must implement hashCode properly!NOTE: When scoring multiple parameters, the second must exceed in score in order to be chosen, if all scores are equal the first parameter will be selected. |
static <A,B> ParamAndField<A,B> |
pickBest(FieldScoreProducer<A,B> producer,
A params,
Random random)
Pick a random best
FieldScore when scoring.NOTE: Because an underlying HashMap is used, to guarantee the same randomization, the B parameter must implement hashCode properly! |
static <A,B> ParamAndField<A,B> |
pickBest(Map<A,FieldScores<A,B>> scores,
Random random) |
public static <A,B> ParamAndField<A,B> pickBest(Map<A,FieldScores<A,B>> scores, Random random)
public static <A,B> ParamAndField<A,B> pickBest(FieldScoreProducer<A,B> producer, A params, Random random)
FieldScore when scoring.HashMap is used, to guarantee the same randomization, the B parameter must implement hashCode properly!producer - The producer for the FieldScoresparams - The parameter to pass the producerrandom - Random object to useFieldScore for the chosen field.public static <A,B> ParamAndField<A,B> pickBest(FieldScoreProducer<A,B> producer, A[] params, Random random)
FieldScore when scoring.HashMap is used, to guarantee the same randomization, both the A and B classes must implement hashCode properly!producer - The producer for the FieldScoresparams - The parameters to pass the producerrandom - Random object to useFieldScore for the chosen field, connected to the parameter that produced the best score.Copyright © 2014. All rights reserved.