public class ExponentialGenerator extends java.lang.Object implements NumberGenerator<java.lang.Double>
Constructor and Description |
---|
ExponentialGenerator(double rate,
java.util.Random rng)
Creates a generator of exponentially-distributed values from a distribution
with the specified rate.
|
ExponentialGenerator(NumberGenerator<java.lang.Double> rate,
java.util.Random rng)
Creates a generator of exponentially-distributed values from a distribution
with a rate controlled by the specified generator parameter.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Double |
nextValue()
Generate the next exponential value from the current value of
rate.
|
public ExponentialGenerator(NumberGenerator<java.lang.Double> rate, java.util.Random rng)
rate
- A number generator that provides values to use as the rate for
the exponential distribution. This generator must only return non-zero, positive
values.rng
- The source of randomness used to generate the exponential values.public ExponentialGenerator(double rate, java.util.Random rng)
rate
- The rate (lamda) of the exponential distribution.rng
- The source of randomness used to generate the exponential values.public java.lang.Double nextValue()
nextValue
in interface NumberGenerator<java.lang.Double>