/** * Generates a random value from the {@link HypergeometricDistribution Hypergeometric Distribution}. * * @param populationSize the population size of the Hypergeometric distribution * @param numberOfSuccesses number of successes in the population of the Hypergeometric distribution * @param sampleSize the sample size of the Hypergeometric distribution * @return random value sampled from the Hypergeometric(numberOfSuccesses, sampleSize) distribution * @throws NumberIsTooLargeException if {@code numberOfSuccesses > populationSize}, * or {@code sampleSize > populationSize}. * @throws NotStrictlyPositiveException if {@code populationSize <= 0}. * @throws NotPositiveException if {@code numberOfSuccesses < 0}. */ public int nextHypergeometric(int populationSize, int numberOfSuccesses, int sampleSize) throws NotPositiveException, NotStrictlyPositiveException, NumberIsTooLargeException { return new HypergeometricDistribution(getRandomGenerator(),populationSize, numberOfSuccesses, sampleSize).sample(); }
/** * Generates a random value from the {@link HypergeometricDistribution Hypergeometric Distribution}. * * @param populationSize the population size of the Hypergeometric distribution * @param numberOfSuccesses number of successes in the population of the Hypergeometric distribution * @param sampleSize the sample size of the Hypergeometric distribution * @return random value sampled from the Hypergeometric(numberOfSuccesses, sampleSize) distribution * @throws NumberIsTooLargeException if {@code numberOfSuccesses > populationSize}, * or {@code sampleSize > populationSize}. * @throws NotStrictlyPositiveException if {@code populationSize <= 0}. * @throws NotPositiveException if {@code numberOfSuccesses < 0}. */ public int nextHypergeometric(int populationSize, int numberOfSuccesses, int sampleSize) throws NotPositiveException, NotStrictlyPositiveException, NumberIsTooLargeException { return new HypergeometricDistribution(getRandomGenerator(),populationSize, numberOfSuccesses, sampleSize).sample(); }
/** * Generates a random value from the {@link HypergeometricDistribution Hypergeometric Distribution}. * * @param populationSize the population size of the Hypergeometric distribution * @param numberOfSuccesses number of successes in the population of the Hypergeometric distribution * @param sampleSize the sample size of the Hypergeometric distribution * @return random value sampled from the Hypergeometric(numberOfSuccesses, sampleSize) distribution * @throws NumberIsTooLargeException if {@code numberOfSuccesses > populationSize}, * or {@code sampleSize > populationSize}. * @throws NotStrictlyPositiveException if {@code populationSize <= 0}. * @throws NotPositiveException if {@code numberOfSuccesses < 0}. */ public int nextHypergeometric(int populationSize, int numberOfSuccesses, int sampleSize) throws NotPositiveException, NotStrictlyPositiveException, NumberIsTooLargeException { return new HypergeometricDistribution(getRandomGenerator(),populationSize, numberOfSuccesses, sampleSize).sample(); }