Module: RandomVariable
- Included in:
- Tests::Poisson
- Defined in:
- lib/distros.rb,
lib/random_variable.rb
Overview
# File: distros.rb #
#
#
Author: Jorge F.M. Rinaldi # Contact: [email protected] #
#
#
Date: 2012/11/28 #
#
Defined Under Namespace
Modules: Sampleable, Samples, Tests Classes: Bernoulli, Beta, Binomial, ChiSquared, ContinuousUniform, DiscreteUniform, Exponential, F, Generic, Normal, Pareto, Poisson, Rademacher, Rayleigh, Rectangular
Class Method Summary collapse
-
.list ⇒ Array
obtain a list of the different available random variable class objects.
-
.new_seed ⇒ Numeric
obtain and set an arbitrary new seed.
-
.seed ⇒ Numeric
obtain the current seed in use.
-
.seed=(new_seed) ⇒ Numeric
set and reset the seed to a new seed.
Class Method Details
.list ⇒ Array
obtain a list of the different available random variable class objects
63 64 65 66 67 68 69 70 71 72 |
# File 'lib/random_variable.rb', line 63 def self.list distros = [] self.constants.each do |c| c = self.const_get(c) if c.is_a? Class and c != self::Generic then distros << c end end distros end |
.new_seed ⇒ Numeric
obtain and set an arbitrary new seed
41 42 43 |
# File 'lib/random_variable.rb', line 41 def self.new_seed Generator::new_seed end |
.seed ⇒ Numeric
obtain the current seed in use
48 49 50 |
# File 'lib/random_variable.rb', line 48 def self.seed Generator::seed end |
.seed=(new_seed) ⇒ Numeric
set and reset the seed to a new seed
56 57 58 |
# File 'lib/random_variable.rb', line 56 def self.seed=(new_seed) Generator::seed = new_seed end |