BayesianNetwork bn = BayesNetExampleFactory
.constructCloudySprinklerRainWetGrassNetwork();
AssignmentProposition[] e = new AssignmentProposition[] { new AssignmentProposition(
ExampleRV.SPRINKLER_RV, Boolean.TRUE) };
MockRandomizer r = new MockRandomizer(new double[] { 0.1 });
RejectionSampling rs = new RejectionSampling(new PriorSample(r));
double[] estimate = rs.rejectionSampling(
new RandomVariable[] { ExampleRV.RAIN_RV }, e, bn, 100)
.getValues();
Assert.assertArrayEquals(new double[] { 1.0, 0.0 }, estimate,
DELTA_THRESHOLD);