public class ProbabilityManager extends Object
Constructor and Description |
---|
ProbabilityManager(Object key) |
Modifier and Type | Method and Description |
---|---|
void |
addProbability(Object key,
Object compKey,
double compFactor)
Set key to be compKey * compFactor and adjust all values so that they still
add up to 1 and at the same time, the value of compKey remains the same
relative to other values.
|
Double |
getProbability(Object key) |
double |
getProbabilityValue(Object key) |
Object |
guessKey() |
Object |
guessKey(double valueGuess) |
static void |
test() |
public ProbabilityManager(Object key)
public void addProbability(Object key, Object compKey, double compFactor)
key
- The key to add (may be there already, in which case it's changedcompKey
- Use the value of 'compKey' to create the value for 'key'compFactor
- Let 'key' = 'compFactor' * 'compKey'.public Object guessKey()
public Object guessKey(double valueGuess)
public double getProbabilityValue(Object key)
public static void test()