public class DistBernoulli extends DistributionCategorical<Sampler.Binary> implements java.io.Serializable
DistributionCategorical.Range
CUMULATIVE_PROB_TOLERANCE
Constructor and Description |
---|
DistBernoulli(double p)
Create a Bernoulli distribution instance.
|
Modifier and Type | Method and Description |
---|---|
Distribution |
createUnregisteredCopy()
Create an unregistered copy of this distribution.
|
double |
getP()
Get the distribution's p value (probability of success).
|
void |
setP(double p)
Change (set) the p value of the distribution.
|
java.lang.String |
toString()
Custom toString implementation.
|
addRange, clearRanges, getK, isLocked, lock, sampleCategory, unlock, usesEnumCategory, usesMappedRanges
sampleDouble, sampleInt
createRegisteredCopy
getSampler, registerAccessInfo, registerSampler
public DistBernoulli(double p)
p
- The p value (success probability) for the trial.public void setP(double p)
p
- The new p value (probability of success).public double getP()
public java.lang.String toString()
toString
in class DistributionCategorical<Sampler.Binary>
"Bernoulli(0.8)"
.public Distribution createUnregisteredCopy()
createUnregisteredCopy
in class Distribution