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);
SearchK2 search = (SearchK2)train.getSearch();
double p = search.calculateG(network, x1, x1.getParents());
Assert.assertEquals(3.607503E-4, p, 0.0001);
network.createDependency(x1, x2);
p = search.calculateG(network, x2, x2.getParents());
Assert.assertEquals(0.0011111, p, 0.0001);
network.createDependency(x2, x3);
p = search.calculateG(network, x3, x3.getParents());
Assert.assertEquals(0.0011111, p, 0.00555555);
}