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