public class RoundedDistribution extends DiscreteDistribution
Meaning: | The "rounded distribution" is a discrete distribution that converts the
value obtained from a continuous ("base") distribution to an integer value
using the
rint() function from the Java
Math package.
rint(x)
returns the integer value nearest to x (e.g.,
rint(1.4) is 1.0 and
rint(1.6) is 2.0). |
---|---|
Parameters: | continuous base distribution f(x) (DF F(x)) |
Distribution: | P(X=i) = F(i+\frac{1}{2})-F(i-\frac{1}{2}) |
Parser example: |
[...].Distribution = RoundedDistribution
|
Modifier and Type | Field and Description |
---|---|
ContinuousDistribution |
baseDist |
rng
CREATE_INSTANCE_METHOD_NAME
Constructor and Description |
---|
RoundedDistribution(ContinuousDistribution baseDist) |
Modifier and Type | Method and Description |
---|---|
static RoundedDistribution |
createInstance(SimNode ownNode,
Parameters pars,
RandomNumberGenerator rng)
as required by
ReflectionConstructable |
int |
next()
Returns the rounded value of the base distribution or
Integer.MIN/MAX_VALUE if the value exceeds the integer range. |
getDefaultRNG, getRandomNumberGenerator, reset
public final ContinuousDistribution baseDist
public RoundedDistribution(ContinuousDistribution baseDist)
public static RoundedDistribution createInstance(SimNode ownNode, Parameters pars, RandomNumberGenerator rng)
ReflectionConstructable
public int next()
Integer.MIN/MAX_VALUE
if the value exceeds the integer range.next
in class DiscreteDistribution