double next = 0.0;
double tolerance = 0.1;
vs.computeDistribution();
Assert.assertTrue("empirical distribution property",
vs.getEmpiricalDistribution() != null);
SummaryStatistics stats = new SummaryStatistics();
for (int i = 1; i < 1000; i++) {
next = vs.getNext();
stats.addValue(next);
}
Assert.assertEquals("mean", 5.069831575018909, stats.getMean(), tolerance);
Assert.assertEquals("std dev", 1.0173699343977738, stats.getStandardDeviation(),
tolerance);
vs.computeDistribution(500);
stats = new SummaryStatistics();
for (int i = 1; i < 1000; i++) {
next = vs.getNext();
stats.addValue(next);
}
Assert.assertEquals("mean", 5.069831575018909, stats.getMean(), tolerance);
Assert.assertEquals("std dev", 1.0173699343977738, stats.getStandardDeviation(),
tolerance);
}