Interface RandomWeibull

A configurable random number generator with one of the generalized extreme value distributions.

interface RandomWeibull {
    source(source): RandomWeibull;
    (k, a?, b?): (() => number);
}

Hierarchy

  • Returns a function for generating random numbers with one of the generalized extreme value distributions, depending on k: If k is positive, the Weibull distribution with shape parameter k If k is zero, the Gumbel distribution If k is negative, the Fréchet distribution with shape parameter −k In all three cases, a is the location parameter and b is the scale parameter. If a is not specified, it defaults to 0; if b is not specified, it defaults to 1.

    Parameters

    • k: number

      Shape parameter

    • Optional a: number

      Location parameter

    • Optional b: number

      Scale parameter

    Returns (() => number)

      • (): number
      • Returns a function for generating random numbers with one of the generalized extreme value distributions, depending on k: If k is positive, the Weibull distribution with shape parameter k If k is zero, the Gumbel distribution If k is negative, the Fréchet distribution with shape parameter −k In all three cases, a is the location parameter and b is the scale parameter. If a is not specified, it defaults to 0; if b is not specified, it defaults to 1.

        Returns number

Methods

Methods

  • Returns the same type of function for generating random numbers but where the given random number generator source is used as the source of randomness instead of Math.random. This is useful when a seeded random number generator is preferable to Math.random.

    Parameters

    • source: (() => number)

      Source (pseudo-)random number generator implementing the Math.random interface. The given random number generator must implement the same interface as Math.random and only return values in the range [0, 1).

        • (): number
        • Returns number

    Returns RandomWeibull