java.lang.Object
org.bzdev.math.rv.RandomVariable<Double>
org.bzdev.math.rv.DoubleRandomVariable
org.bzdev.math.rv.ExpDistrRV
- All Implemented Interfaces:
Cloneable
,RandomVariableOps<Double>
Class for exponentially distributed interarrival times suitable for
events with a Poisson distribution.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
getMean()
Get the mean value of the distribution.next()
Get the next value for a random variable.next
(int n) Get a random number that represents the sum of n interarrival times for an exponentially distributed random variable, where each value is independent of another.Methods inherited from class org.bzdev.math.rv.DoubleRandomVariable
getMaximum, getMaximumClosed, getMinimum, getMinimumClosed, parallelStream, parallelStream, rangeTestFailed, rangeTestNeeded, setMaximum, setMinimum, setRequiredMaximum, setRequiredMinimum, spliterator, spliterator, stream, stream, tightenMaximum, tightenMaximumS, tightenMinimum, tightenMinimumS
Methods inherited from class org.bzdev.math.rv.RandomVariable
clone, getCharacteristics
-
Constructor Details
-
ExpDistrRV
Constructor.- Parameters:
mean
- the mean value for the random variable- Throws:
IllegalArgumentException
-
-
Method Details
-
getMean
public double getMean()Get the mean value of the distribution.- Returns:
- the mean value of the distribution
-
next
Description copied from class:RandomVariable
Get the next value for a random variable. In general, each value will be independent of the last.- Specified by:
next
in interfaceRandomVariableOps<Double>
- Specified by:
next
in classRandomVariable<Double>
- Returns:
- the next value
-
next
Get a random number that represents the sum of n interarrival times for an exponentially distributed random variable, where each value is independent of another. The implementation is more efficient than adding the results of calling next() n times. The range test (if any) tests the returned value divided by n.- Parameters:
n
- the number of interarrival times to sum- Returns:
- the sum of n values of this random variable
-