EmpiricalDistribution extends AbstractRealDistribution { public void reSeed(long seed) { randomData.reSeed(seed); } EmpiricalDistribution();  EmpiricalDistribution(int binCount);  EmpiricalDistribution(int binCount, RandomGenerator generator);  EmpiricalDistribution(RandomGenerator generator); @Deprecated  EmpiricalDistribution(int binCount, RandomDataImpl randomData); @Deprecated  EmpiricalDistribution(RandomDataImpl randomData); private  EmpiricalDistribution(int binCount,
                                  RandomDataGenerator randomData); void load(double[] in); void load(URL url); void load(File file); double getNextValue(); StatisticalSummary getSampleStats(); int getBinCount(); List<SummaryStatistics> getBinStats(); double[] getUpperBounds(); double[] getGeneratorUpperBounds(); boolean isLoaded(); void reSeed(long seed); @Override double probability(double x); double density(double x); double cumulativeProbability(double x); @Override double inverseCumulativeProbability(final double p); double getNumericalMean(); double getNumericalVariance(); double getSupportLowerBound(); double getSupportUpperBound(); boolean isSupportLowerBoundInclusive(); boolean isSupportUpperBoundInclusive(); boolean isSupportConnected(); @Override void reseedRandomGenerator(long seed); static final int DEFAULT_BIN_COUNT; }
@Test public void testReSeed() throws Exception { empiricalDistribution.load(url); empiricalDistribution.reSeed(100); final double [] values = new double[10]; for (int i = 0; i < 10; i++) { values[i] = empiricalDistribution.getNextValue(); } empiricalDistribution.reSeed(100); for (int i = 0; i < 10; i++) { Assert.assertEquals(values[i],empiricalDistribution.getNextValue(), 0d); } }