Class: Spark::Sampler::Base
- Inherits:
-
Object
- Object
- Spark::Sampler::Base
- Defined in:
- lib/spark/sampler.rb
Instance Attribute Summary collapse
-
#fraction ⇒ Object
readonly
Returns the value of attribute fraction.
-
#seed ⇒ Object
readonly
Returns the value of attribute seed.
Instance Method Summary collapse
-
#initialize(fraction, seed = nil) ⇒ Base
constructor
A new instance of Base.
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
#fraction ⇒ Object (readonly)
Returns the value of attribute fraction.
35 36 37 |
# File 'lib/spark/sampler.rb', line 35 def fraction @fraction end |
#seed ⇒ Object (readonly)
Returns the value of attribute seed.
35 36 37 |
# File 'lib/spark/sampler.rb', line 35 def seed @seed end |