Search in sources :

Example 1 with Marginalizer

use of org.drools.beliefs.bayes.Marginalizer in project drools by kiegroup.

the class SprinkerTest method marginalize.

public static void marginalize(BayesVariableState varState, CliqueState cliqueState) {
    JunctionTreeClique jtNode = cliqueState.getJunctionTreeClique();
    new Marginalizer(jtNode.getValues().toArray(new BayesVariable[jtNode.getValues().size()]), cliqueState.getPotentials(), varState.getVariable(), varState.getDistribution());
    System.out.print(varState.getVariable().getName() + " ");
    for (double d : varState.getDistribution()) {
        System.out.print(d);
        System.out.print(" ");
    }
    System.out.println(" ");
}
Also used : Marginalizer(org.drools.beliefs.bayes.Marginalizer) BayesVariable(org.drools.beliefs.bayes.BayesVariable) JunctionTreeClique(org.drools.beliefs.bayes.JunctionTreeClique)

Aggregations

BayesVariable (org.drools.beliefs.bayes.BayesVariable)1 JunctionTreeClique (org.drools.beliefs.bayes.JunctionTreeClique)1 Marginalizer (org.drools.beliefs.bayes.Marginalizer)1