use of org.drools.beliefs.bayes.JunctionTreeBuilder in project drools by kiegroup.
the class EarthQuakeTest method setUp.
@Before
public void setUp() {
connectParentToChildren(burglaryNode, alarmNode);
connectParentToChildren(earthquakeNode, alarmNode);
connectParentToChildren(alarmNode, johnCallsNode, maryCallsNode);
burglaryNode.setContent(burglary);
earthquakeNode.setContent(earthquake);
alarmNode.setContent(alarm);
johnCallsNode.setContent(johnCalls);
maryCallsNode.setContent(maryCalls);
JunctionTreeBuilder jtBuilder = new JunctionTreeBuilder(graph);
jTree = jtBuilder.build();
// jTree.initialize();
jtNode1 = jTree.getRoot();
jtNode2 = jtNode1.getChildren().get(0).getChild();
jtNode3 = jtNode1.getChildren().get(1).getChild();
bayesInstance = new BayesInstance(jTree);
burglaryState = bayesInstance.getVarStates()[burglary.getId()];
earthquakeState = bayesInstance.getVarStates()[earthquake.getId()];
alarmState = bayesInstance.getVarStates()[alarm.getId()];
johnCallsState = bayesInstance.getVarStates()[johnCalls.getId()];
maryCallsState = bayesInstance.getVarStates()[maryCalls.getId()];
}
Aggregations