{
BayesianNetwork network = new BayesianNetwork();
BayesianEvent a = network.createEvent("a");
BayesianEvent b = network.createEvent("b");
network.createDependency(a, b);
network.finalizeStructure();
a.getTable().addLine(0.5, true); // P(A) = 0.5
b.getTable().addLine(0.2, true, true); // p(b|a) = 0.2
b.getTable().addLine(0.8, true, false);// p(b|~a) = 0.8
network.validate();