Class BinomialIATimeRV

All Implemented Interfaces:
Cloneable, RandomVariableOps<Long>

public class BinomialIATimeRV extends InterarrivalTimeRV
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 Details

    • BinomialIATimeRV

      public BinomialIATimeRV(double prob, long n) throws IllegalArgumentException
      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

      public Long 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 interface RandomVariableOps<Long>
      Specified by:
      next in class RandomVariable<Long>
      Returns:
      the next value