public class Probability
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Probability |
ONE
The Constant ONE.
|
static Probability |
ZERO
The Constant ZERO.
|
Constructor and Description |
---|
Probability(double probability)
Instantiates a new probability.
|
Modifier and Type | Method and Description |
---|---|
boolean |
nextEvent()
Generates an event according the probability value p.
|
java.lang.String |
toString() |
public static final Probability ZERO
public static final Probability ONE
public Probability(double probability)
probability
- The probability value (a number in the range 0..1 inclusive). A
value of zero means that an event is guaranteed not to happen. A value of 1 means
it is guaranteed to occur.