Class Erlang

All Implemented Interfaces:
ContinuousGenerator, Seedable

public class Erlang extends Generator implements ContinuousGenerator
A random number generator based on the Erlang distribution.
  • Field Summary

    Fields inherited from class Generator

    distrib
    Modifier and Type
    Field
    Description
    protected Distributions
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Erlang(double shape, double scale)
    the seed is automatically provided by the SeedGenerator
    Erlang(double shape, double scale, long seed)
    The constructor with which a specific seed is set for the random number generator
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Generate a new random number.

    Methods inherited from class Generator

    getSeed, reseed, setSeed
    Modifier and Type
    Method
    Description
    long
    Get the random number generator's seed.
    void
    Get another seed well-spaced (from the default SeedGenerator)
    void
    setSeed(long seed)
    Set the random number generator's seed.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Erlang

      public Erlang(double shape, double scale)
      the seed is automatically provided by the SeedGenerator
      Parameters:
      shape - The shape of the distribution
      scale - The scale of the distribution
    • Erlang

      public Erlang(double shape, double scale, long seed)
      The constructor with which a specific seed is set for the random number generator
      Parameters:
      shape - The shape of the distribution
      scale - The scale of the distribution
      seed - The initial seed for the generator, two instances with the same seed will generate the same sequence of numbers
  • Method Details

    • sample

      public double sample()
      Generate a new random number.
      Specified by:
      sample in interface ContinuousGenerator
      Returns:
      The next random number in the sequence