|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.colorado.simulations.BooleanSource
public class BooleanSource
A BooleanSource provides a random sequence of boolean values.
| Constructor Summary | |
|---|---|
BooleanSource(double p)
Initialize a BooleanSource. |
|
| Method Summary | |
|---|---|
boolean |
query()
Get the next value from this BooleanSource. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BooleanSource(double p)
BooleanSource.
p - a probability
0 <= p and p <= 1.
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.| Method Detail |
|---|
public boolean query()
BooleanSource.
- - none
true or false,
with the probability of a true value being determined
by the argument that was given to the constructor.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||