public class BooleanSource
extends java.lang.Object
Constructor and Description |
---|
BooleanSource(double p)
Initialize a
BooleanSource . |
Modifier and Type | Method and Description |
---|---|
boolean |
query()
Get the next value from this
BooleanSource . |
public BooleanSource(double p)
BooleanSource
.p
- a probability
Precondition:
0 <= p
and p <= 1
.
Postcondition:
This BooleanSource
has been initialized so that
p
is the approximate probability of returning
true
in any subsequent activation of the
query
method.java.lang.IllegalArgumentException
- Indicates that p is outside of its legal range.