DiscreteSamplerpublic class DiscreteUniformSampler extends SamplerBase implements DiscreteSampler
| Constructor | Description |
|---|---|
DiscreteUniformSampler(org.apache.commons.rng.UniformRandomProvider rng,
int lower,
int upper) |
| Modifier and Type | Method | Description |
|---|---|---|
int |
sample() |
Creates a sample.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitnextDouble, nextInt, nextInt, nextLongpublic DiscreteUniformSampler(org.apache.commons.rng.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.java.lang.IllegalArgumentException - if lower > upper.public int sample()
sample in interface DiscreteSamplerpublic java.lang.String toString()
toString in class SamplerBaseCopyright © 2016–2018 The Apache Software Foundation. All rights reserved.