public class DiscreteDistUniform extends DiscreteDist<java.lang.Long>
Distribution
Constructor and Description |
---|
DiscreteDistUniform(Model owner,
java.lang.String name,
long minValue,
long maxValue,
boolean showInReport,
boolean showInTrace)
Creates a stream of pseudo random numbers following a uniform
distribution.
|
Modifier and Type | Method and Description |
---|---|
Reporter |
createDefaultReporter()
Creates the default reporter for the UniformDiscreteDist distribution.
|
java.lang.Long |
getInverseOfCumulativeProbabilityFunction(double p)
Abstract method to map a double
p from 0...1 to the
distribution's domain by determining the value x that satisfies
P(X < x) = p . |
long |
getLower()
Returns the lower border of the range of this distribution.
|
long |
getUpper()
Returns the upper border of the range of this distribution.
|
java.lang.Long |
sample()
Returns the next uniformly distributed integer sample.
|
void |
setNonNegative(boolean newValue)
Overrides the same method of
desmoj.dist.Distribution . |
sampleObject, sampleTimeSpan, sampleTimeSpan
changeRandomGenerator, getInitialSeed, getNonNegative, getNumSamples, isAntithetic, reset, reset, setAntithetic, setSeed
getCorrespondingSchedulable, getDescription, getObservations, getReporter, incrementObservations, incrementObservations, reportIsOn, reportOff, reportOn, resetAt, setCorrespondingSchedulable, setDescription, setReporter
current, currentEntity, currentEntityAll, currentEvent, currentModel, currentSimProcess, debugIsOn, debugOff, debugOn, getModel, isExperimentCompatible, isModelCompatible, presentTime, sendDebugNote, sendMessage, sendTraceNote, sendWarning, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOn
getName, getQuotedName, toString
public DiscreteDistUniform(Model owner, java.lang.String name, long minValue, long maxValue, boolean showInReport, boolean showInTrace)
Long.MAX_VALUE
for arithmetic reasons.owner
- Model : The distribution's ownername
- java.lang.String : The distribution's nameminValue
- long : The minimum value for this distributionmaxValue
- long : The maximum value for this distributionshowInReport
- boolean : Flag for producing reportsshowInTrace
- boolean : Flag for producing trace outputpublic Reporter createDefaultReporter()
createDefaultReporter
in class Distribution
DiscreteDistUniformReporter
public long getLower()
public long getUpper()
public java.lang.Long sample()
sample
in class NumericalDist<java.lang.Long>
public java.lang.Long getInverseOfCumulativeProbabilityFunction(double p)
p
from 0...1 to the
distribution's domain by determining the value x that satisfies
P(X < x) = p
.getInverseOfCumulativeProbabilityFunction
in class NumericalDist<java.lang.Long>
p
- double: A value between 0 and 1P(X < x) = p
public void setNonNegative(boolean newValue)
desmoj.dist.Distribution
. It
makes no sense to set a UniformDiscreteDist
object with a
negative lower border to nonNegative. In this case a warning will be
sent. true
the distribution returns positive samples only,
otherwise it also produces negative samples, if possible.setNonNegative
in class Distribution
newValue
- boolean : If true
the distribution is set to
return positive samples only, otherwise it also produces
negative samples, if possible.