Class: ERV::Distribution
Direct Known Subclasses
ConstantDistribution, DiscreteUniformDistribution, ExponentialDistribution, GammaDistribution, GaussianDistribution, GeometricDistribution, GpdDistribution, UniformDistribution
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Distribution
constructor
A new instance of Distribution.
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 |