Class Beta

All Implemented Interfaces:
ContinuousGenerator, Seedable
Direct Known Subclasses:
BetaPrime

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

    Fields
    Modifier and Type
    Field
    Description
    protected double
     
    protected double
     

    Fields inherited from class eduni.distributions.Generator

    distrib
  • Constructor Summary

    Constructors
    Constructor
    Description
    Beta(double shape_a, double shape_b)
    the seed is automatically provided by the SeedGenerator
    Beta(double shape_a, double shape_b, 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 eduni.distributions.Generator

    getSeed, reseed, setSeed

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface eduni.distributions.Seedable

    getSeed, reseed, setSeed
  • Field Details

    • shape_a

      protected double shape_a
    • shape_b

      protected double shape_b
  • Constructor Details

    • Beta

      public Beta(double shape_a, double shape_b)
      the seed is automatically provided by the SeedGenerator
      Parameters:
      shape_a - The a shape parameter of the distribution
      shape_b - The b shape parameter of the distribution
    • Beta

      public Beta(double shape_a, double shape_b, long seed)
      The constructor with which a specific seed is set for the random number generator
      Parameters:
      shape_a - The a shape parameter of the distribution
      shape_b - The b shape parameter 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