public class DiscreteUniformSampler extends SamplerBase implements DiscreteSampler
| Constructor and Description |
|---|
DiscreteUniformSampler(UniformRandomProvider rng,
int lower,
int upper) |
| Modifier and Type | Method and Description |
|---|---|
int |
sample()
Creates a sample.
|
String |
toString() |
nextDouble, nextInt, nextIntpublic DiscreteUniformSampler(UniformRandomProvider rng, int lower, int upper)
rng - Generator of uniformly distributed random numbers.lower - Lower bound (inclusive) of the distribution.upper - Upper bound (inclusive) of the distribution.IllegalArgumentException - if lower > upper.public int sample()
sample in interface DiscreteSamplerpublic String toString()
toString in class SamplerBaseCopyright © 2016 The Apache Software Foundation. All rights reserved.