public class DiscreteDistConstant<N extends java.lang.Number> extends DiscreteDist<N>
Distribution
Constructor and Description |
---|
DiscreteDistConstant(Model owner,
java.lang.String name,
N constantValue,
boolean showInReport,
boolean showInTrace)
Constructs a simple distribution which produces samples equal to the
constant value it has been given.
|
Modifier and Type | Method and Description |
---|---|
Reporter |
createDefaultReporter()
Creates the default reporter for the constant distribution.
|
N |
getConstantValue()
Returns the constant value associated with this
ConstantDiscreteDist distribution |
N |
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 . |
N |
sample()
Returns the next constant sample of this distribution.
|
void |
setConstant(N newValue)
Changes the constant value to the new one specified.
|
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 DiscreteDistConstant(Model owner, java.lang.String name, N constantValue, boolean showInReport, boolean showInTrace)
owner
- Model : The distribution's ownername
- java.lang.String : The distribution's nameconstantValue
- N : The constant value produced by this distributionshowInReport
- boolean : Flag for producing reportsshowInTrace
- boolean : Flag for producing trace outputpublic Reporter createDefaultReporter()
createDefaultReporter
in class Distribution
DistributionReporter
public N getConstantValue()
ConstantDiscreteDist
distributionConstantDiscreteDist
distributionpublic N sample()
sample
in class NumericalDist<N extends java.lang.Number>
public N 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<N extends java.lang.Number>
p
- double: A value between 0 and 1public void setConstant(N newValue)
newValue
- N : the new value to be returned by this pseudo
distributionpublic void setNonNegative(boolean newValue)
desmoj.dist.Distribution
. It
makes no sense to set a ConstantDiscreteDist
object with a
negative constant 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.