Class: Spark::Sampler::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/spark/sampler.rb

Direct Known Subclasses

Poisson, Uniform

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fraction, seed = nil) ⇒ Base

Returns a new instance of Base.



37
38
39
40
# File 'lib/spark/sampler.rb', line 37

def initialize(fraction, seed=nil)
  @fraction = fraction
  @seed = seed || Random.new_seed
end

Instance Attribute Details

#fractionObject (readonly)

Returns the value of attribute fraction.



35
36
37
# File 'lib/spark/sampler.rb', line 35

def fraction
  @fraction
end

#seedObject (readonly)

Returns the value of attribute seed.



35
36
37
# File 'lib/spark/sampler.rb', line 35

def seed
  @seed
end