Class: RV::Erlang

Inherits:
Weibull show all
Defined in:
lib/random_variates.rb

Overview

Erlang generator - Weibull restricted to integer k

Arguments
  • rate -> the scale parameter (+rate+ > 0; default: 1).
  • k -> the shape parameter (+k+ > 0; default: 1).
  • rng -> the (+Enumerable+) source of U(0, 1)'s (default: U_GENERATOR)

Instance Attribute Summary

Attributes inherited from Weibull

#k, #rate

Instance Method Summary collapse

Methods inherited from Weibull

#next

Methods included from RV_Generator

#each, #next

Constructor Details

#initialize(rate: 1.0, k: 1, rng: U_GENERATOR) ⇒ Erlang

Returns a new instance of Erlang.



357
358
359
360
361
# File 'lib/random_variates.rb', line 357

def initialize(rate: 1.0, k: 1, rng: U_GENERATOR)
  raise 'K must be integer.' unless k.integer?

  super(rate: rate, k: k, rng: rng)
end