Class: ERV::Distribution

Inherits:
Object show all
Defined in:
lib/erv/distribution.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Distribution

Returns a new instance of Distribution.



4
5
6
7
8
9
10
11
12
13
# File 'lib/erv/distribution.rb', line 4

def initialize(opts={})
  # use provided RNG or create a new one
  if opts[:rng]
    @rng = opts[:rng]
  elsif opts[:seed]
    @rng = Random.new(opts[:seed])
  else
    @rng = Random.new
  end
end