public class DiscreteDistEmpirical<N extends java.lang.Number> extends DiscreteDist<N>
addEntry()
method.Distribution
Constructor and Description |
---|
DiscreteDistEmpirical(Model owner,
java.lang.String name,
boolean showInReport,
boolean showInTrace)
Constructs an empirical distribution producing double values.
|
Modifier and Type | Method and Description |
---|---|
void |
addEntry(N value,
double frequency)
Adds a new entry of an empirical value and its associated frequency.
|
Reporter |
createDefaultReporter()
Creates the default reporter for the EmpiricalDiscreteDist 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 . |
boolean |
isInitialized()
Shows if the EmpiricalDiscreteDist distribution already is initialized.
|
void |
removeEntry(N value)
Removes all entries of an empirical value.
|
void |
removeEntry(N value,
double tolerance)
Removes all entries of all empirical values close
to a given value.
|
N |
sample()
Returns the next sample specified by the empirical distribution.
|
sampleObject, sampleTimeSpan, sampleTimeSpan
changeRandomGenerator, 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 DiscreteDistEmpirical(Model owner, java.lang.String name, boolean showInReport, boolean showInTrace)
addEntry(double, double)
method to add values
defining the behaviour of the desired distribution.sowner
- Model : The distribution's ownername
- java.lang.String : The distribution's nameshowInReport
- boolean : Flag for producing reportsshowInTrace
- boolean : Flag for producing trace outputpublic void addEntry(N value, double frequency)
value
- N : The empirical value observedfrequency
- double : The corresponding frequency of the empirical valuepublic void removeEntry(N value)
value
- N : The value to be removedpublic void removeEntry(N value, double tolerance)
addEntriy(42.42, 5)
, you might find the value
actually stored is 42.42000000000001.
To remove this entry independently of its precise internal
representation, use e.g. removeEntry(42.42, 0.0001)
.
(This assumes all other values stored in this distribution
differ by more than 0.001 from 42.42.)value
- N : The value to be removedtolerance
- double : The value to be removedpublic Reporter createDefaultReporter()
createDefaultReporter
in class Distribution
DiscreteDistEmpiricalReporter
public boolean isInitialized()
addEntry(double, double)
method.public 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 1P(X < x) = p