DiscreteSampler
public 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, wait
nextDouble, nextInt, nextInt, nextLong
public 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 DiscreteSampler
public java.lang.String toString()
toString
in class SamplerBase
Copyright © 2016–2018 The Apache Software Foundation. All rights reserved.