BayesianNetwork network = new BayesianNetwork();
BayesianEvent x1 = network.createEvent("x1", labels);
BayesianEvent x2 = network.createEvent("x2", labels);
BayesianEvent x3 = network.createEvent("x3", labels);
network.finalizeStructure();
TrainBayesian train = new TrainBayesian(network,data,10);
train.setInitNetwork(BayesianInit.InitEmpty);
while(!train.isTrainingDone()) {
train.iteration();
}
train.iteration();
Assert.assertTrue(x1.getParents().size()==0);
Assert.assertTrue(x2.getParents().size()==1);
Assert.assertTrue(x3.getParents().size()==1);
Assert.assertTrue(x2.getParents().contains(x1));
Assert.assertTrue(x3.getParents().contains(x2));