public class DiscreteUniformDistribution extends DiscreteDistribution
Meaning: | All integer values \(i\) in the interval \(b_l \le i < b_u \) (\(b_l\) and \(b_u\) being also integer values) have the same probability \(\frac{1}{b_u-b_l}\) |
---|---|
Parameters: |
|
Distribution: | \(P(X=i) = \begin{cases} \frac{1}{b_u-b_l} &\mbox{for } b_l \le i < b_u \\ 0 & \mbox{else } \end{cases} \) |
Expected value: | \(E[X]=\frac{b_l+b_u-1}{2} \) |
Variance: | \(VAR[X]=\frac{(b_u-b_l-1) \cdot (b_u-b_l+1)}{12}\) |
Coefficient of variation: | \(c_X=\frac{ \sqrt{ (b_u-b_l-1) \cdot (b_u-b_l+1) } }{ \sqrt{3} \cdot (b_l+b_u-1)}\) |
Generating func.: | \(G(z)=z^{b_l}+...+z^{b_u-1} \) |
Parser example: |
[...].Distribution = DiscreteUniform
|
Modifier and Type | Field and Description |
---|---|
int |
interval |
int |
lowerBound |
rng
CREATE_INSTANCE_METHOD_NAME
Constructor and Description |
---|
DiscreteUniformDistribution(int lowerBound,
int upperBound) |
DiscreteUniformDistribution(int lowerBound,
int upperBound,
RandomNumberGenerator rng) |
Modifier and Type | Method and Description |
---|---|
static DiscreteUniformDistribution |
createInstance(SimNode ownNode,
Parameters pars,
RandomNumberGenerator rng)
as required by
ReflectionConstructable |
int |
next()
Create random numbers
|
getDefaultRNG, getRandomNumberGenerator, reset
public DiscreteUniformDistribution(int lowerBound, int upperBound, RandomNumberGenerator rng)
public DiscreteUniformDistribution(int lowerBound, int upperBound)
public static DiscreteUniformDistribution createInstance(SimNode ownNode, Parameters pars, RandomNumberGenerator rng)
ReflectionConstructable
public int next()
DiscreteDistribution
next
in class DiscreteDistribution