public abstract class NumericalDist<N extends java.lang.Number> extends Distribution
Constructor and Description |
---|
NumericalDist(Model owner,
java.lang.String name,
boolean showInReport,
boolean showInTrace) |
Modifier and Type | Method and Description |
---|---|
abstract 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()
Method to return the specific sample as a value of type N.
|
java.lang.Object |
sampleObject()
Convenience method to return the distribution's sample as
Object . |
TimeSpan |
sampleTimeSpan()
Convenience method to sample a period of random length by creating a
TimeSpan whose length is determined by sampling this
distribution (time unit is the experiment's reference units),
thus replacing the pattern new TimeSpan(distribution.sample()) . |
TimeSpan |
sampleTimeSpan(java.util.concurrent.TimeUnit unit)
Convenience method to sample a period of random length by creating a
TimeSpan whose length is determined by sampling this
distribution (time unit given explicitly as parameter), thus replacing
the pattern new TimeSpan(distribution.sample(), unit) . |
changeRandomGenerator, createDefaultReporter, getInitialSeed, getNonNegative, getNumSamples, isAntithetic, reset, reset, setAntithetic, setNonNegative, 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 NumericalDist(Model owner, java.lang.String name, boolean showInReport, boolean showInTrace)
public N sample()
getInverseCumulativeProbability()
,
to which a random number from randomGenerator
is passed.
Subclasses may need to refine this method if getInverseCumulativeProbability()
is not implemented as the distribution does not support inverse transformation.public abstract N getInverseOfCumulativeProbabilityFunction(double p)
p
from 0...1 to the
distribution's domain by determining the value x that satisfies
P(X < x) = p
.p
- double: A value between 0 and 1P(X < x) = p
public TimeSpan sampleTimeSpan()
TimeSpan
whose length is determined by sampling this
distribution (time unit is the experiment's reference units),
thus replacing the pattern new TimeSpan(distribution.sample())
.public TimeSpan sampleTimeSpan(java.util.concurrent.TimeUnit unit)
TimeSpan
whose length is determined by sampling this
distribution (time unit given explicitly as parameter), thus replacing
the pattern new TimeSpan(distribution.sample(), unit)
.unit
- TimeUnit: the TimeUnit to assign to the sampled valuepublic java.lang.Object sampleObject()
Object
.
For type safety, method sample()
should be preferred. However,
this method is useful for environments requiring a non-genetic access point
to obtain samples from any distribution.sampleObject
in class Distribution
Object
.