public class BoolDistBernoulli extends BoolDist
true
values with the
given probability. Samples of this distribution can either be true or false
with a given probability for value "true". The probabilitiy for "true" can
only be set via the constructor. It has to be a value between 0 and 1. Higher
values will be interpreted as 1 (always return "true"). Negative values will
be interpreted as 0 (always return "false").Constructor and Description |
---|
BoolDistBernoulli(Model owner,
java.lang.String name,
double probabilityForTrue,
boolean showInReport,
boolean showInTrace)
Constructs a boolean Bernoulli distribution with the given probability to
return a "true" value.
|
Modifier and Type | Method and Description |
---|---|
Reporter |
createDefaultReporter()
Creates the default reporter for the
BoolDistBernoulli
distribution. |
double |
getProbability()
Returns the probability for
true values. |
boolean |
sample()
Returns the next Bernoulli distributed sample of the distribution.
|
sampleObject
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 BoolDistBernoulli(Model owner, java.lang.String name, double probabilityForTrue, boolean showInReport, boolean showInTrace)
owner
- Model : The distribution's ownername
- java.lang.String : The distribution's nameprobabilityForTrue
- double : The probability for producing a true
sampleshowInReport
- boolean : Flag for producing reportsshowInTrace
- boolean : Flag for producing trace outputpublic Reporter createDefaultReporter()
BoolDistBernoulli
distribution.createDefaultReporter
in class Distribution
BoolDistBernoulli
distributionDistributionReporter
public double getProbability()
true
values. The value returned
is passed through the constructor.true
value being
returnedpublic boolean sample()