java.lang.Object
org.bzdev.math.rv.RandomVariable<Long>
org.bzdev.math.rv.LongRandomVariable
org.bzdev.math.rv.InterarrivalTimeRV
org.bzdev.math.rv.BinomialIATimeRV
- All Implemented Interfaces:
Cloneable
,RandomVariableOps<Long>
Long random variable that generates a binomial distribution for n
tries, treated as an interarrival time. Each number in the
sequence represents the number of successful tries out of n tries.
An interarrival time is defined to be a non-negative long integer
(as required by the package org.bzdev.devqsim
and packages
based on that package). The class InterarrivalTimeRV
enforces
the restriction that the value generated is not negative. When that
class is used, the Java type system prevents setting a variable of that
type to an instance of BinomialLongRV
, even though that class
would produce the desired values.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.bzdev.math.rv.LongRandomVariable
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
-
BinomialIATimeRV
Constructor.- Parameters:
prob
- the probability that a try succeeds.n
- the number of tries (must be positive)- Throws:
IllegalArgumentException
-
-
Method Details
-
getProb
public double getProb()Get the probability that a try succeeds.- Returns:
- the probability that a try succeeds.
-
getN
public long getN()Get the number of tries for this random variable.- Returns:
- the number of tries
-
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<Long>
- Specified by:
next
in classRandomVariable<Long>
- Returns:
- the next value
-