Class: PlanOut::BernoulliTrial
- Defined in:
- lib/plan_out/op_random.rb
Constant Summary
Constants inherited from OpRandom
Instance Attribute Summary
Attributes inherited from Operator
Instance Method Summary collapse
Methods inherited from OpRandom
#get_hash, #get_uniform, #get_unit
Methods inherited from OpSimple
Methods inherited from Operator
Constructor Details
This class inherits a constructor from PlanOut::Operator
Instance Method Details
#simple_execute ⇒ Object
46 47 48 49 50 |
# File 'lib/plan_out/op_random.rb', line 46 def simple_execute p = @parameters[:p] rand_val = get_uniform(0.0, 1.0) (rand_val <= p) ? 1 : 0 end |