Package net.ontopia.topicmaps.viz
Class ProbabilityManager
java.lang.Object
net.ontopia.topicmaps.viz.ProbabilityManager
Manages probability values for given keys, so that all probability values
always add up to 1. If a new probability value is added, the other values
are added. This can be used to build up a probability distribution
incrementally while ensuring that the probabilities never add up to more
than 1, i.e. 100%.
Currently not used anywhere.
Should add a method that guesses a 0.0 ... 1.0 number and returns a
corresponding key.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProbability(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.getProbability(Object key) doubleguessKey()guessKey(double valueGuess) static voidtest()
-
Constructor Details
-
ProbabilityManager
-
-
Method Details
-
addProbability
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.- Parameters:
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'.
-
guessKey
-
guessKey
-
getProbability
-
getProbabilityValue
-
test
public static void test()
-