ikr.simlib.distributions.discrete

## Class DiscreteUniformDistribution

• All Implemented Interfaces:
ReflectionConstructable, ReflectionConstructable3<SimNode,Parameters,RandomNumberGenerator>

public class DiscreteUniformDistribution
extends DiscreteDistribution
Discrete Uniform Distribution
Meaning: Parameters: 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}$$ lower limit $$b_l$$ upper limit $$b_u > b_l$$ 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}$$ $$E[X]=\frac{b_l+b_u-1}{2}$$ $$VAR[X]=\frac{(b_u-b_l-1) \cdot (b_u-b_l+1)}{12}$$ $$c_X=\frac{ \sqrt{ (b_u-b_l-1) \cdot (b_u-b_l+1) } }{ \sqrt{3} \cdot (b_l+b_u-1)}$$ $$G(z)=z^{b_l}+...+z^{b_u-1}$$  [...].Distribution = DiscreteUniform [...].Distribution.LowerBound = 3 [...].Distribution.UpperBound = 7 
• ### Field Summary

Fields
Modifier and Type Field and Description
int interval
int lowerBound
• ### Fields inherited from class ikr.simlib.distributions.Distribution

rng
• ### Fields inherited from interface ikr.simlib.parameters.reflection.ReflectionConstructable

CREATE_INSTANCE_METHOD_NAME
• ### Constructor Summary

Constructors
Constructor and Description
DiscreteUniformDistribution(int lowerBound, int upperBound)
DiscreteUniformDistribution(int lowerBound, int upperBound, RandomNumberGenerator rng)
• ### Method Summary

Methods
Modifier and Type Method and Description
static DiscreteUniformDistribution createInstance(SimNode ownNode, Parameters pars, RandomNumberGenerator rng)
int next()
Create random numbers
• ### Methods inherited from class ikr.simlib.distributions.Distribution

getDefaultRNG, getRandomNumberGenerator, reset
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Field Detail

• #### lowerBound

public final int lowerBound
• #### interval

public final int interval
• ### Constructor Detail

• #### DiscreteUniformDistribution

public DiscreteUniformDistribution(int lowerBound,
int upperBound,
RandomNumberGenerator rng)
• #### DiscreteUniformDistribution

public DiscreteUniformDistribution(int lowerBound,
int upperBound)
• ### Method Detail

• #### createInstance

public static DiscreteUniformDistribution createInstance(SimNode ownNode,
Parameters pars,
RandomNumberGenerator rng)
• #### next

public int next()
Description copied from class: DiscreteDistribution
Create random numbers
Specified by:
next in class DiscreteDistribution