}, meningitis);
return new BayesNet(meningitis);
}
public static BayesianNetwork constructBurglaryAlarmNetwork() {
FiniteNode burglary = new FullCPTNode(ExampleRV.BURGLARY_RV,
new double[] { 0.001, 0.999 });
FiniteNode earthquake = new FullCPTNode(ExampleRV.EARTHQUAKE_RV,
new double[] { 0.002, 0.998 });
FiniteNode alarm = new FullCPTNode(ExampleRV.ALARM_RV, new double[] {
// B=true, E=true, A=true
0.95,
// B=true, E=true, A=false
0.05,
// B=true, E=false, A=true
0.94,
// B=true, E=false, A=false
0.06,
// B=false, E=true, A=true
0.29,
// B=false, E=true, A=false
0.71,
// B=false, E=false, A=true
0.001,
// B=false, E=false, A=false
0.999 }, burglary, earthquake);
@SuppressWarnings("unused")
FiniteNode johnCalls = new FullCPTNode(ExampleRV.JOHN_CALLS_RV,
new double[] {
// A=true, J=true
0.90,
// A=true, J=false
0.10,
// A=false, J=true
0.05,
// A=false, J=false
0.95 }, alarm);
@SuppressWarnings("unused")
FiniteNode maryCalls = new FullCPTNode(ExampleRV.MARY_CALLS_RV,
new double[] {
// A=true, M=true
0.70,
// A=true, M=false