Class: Rule
- Inherits:
-
Object
- Object
- Rule
- Defined in:
- lib/rfuzzy/rule.rb
Overview
Represents the Rule for FuzzySystem where both antescendent and consequent are Proc objects
Instance Method Summary collapse
-
#apply ⇒ Object
Calls antecentent and then calls consequent passing the result from antecendent to consequent.
-
#initialize(ant, cons) ⇒ Rule
constructor
Usage:
.new(Proc antecentent, Proc consequent)
.
Constructor Details
#initialize(ant, cons) ⇒ Rule
Usage: .new(Proc antecentent, Proc consequent)
8 9 10 11 |
# File 'lib/rfuzzy/rule.rb', line 8 def initialize(ant, cons) @antecendent = ant @consequent = cons end |
Instance Method Details
#apply ⇒ Object
Calls antecentent and then calls consequent passing the result from antecendent to consequent. In most cases the passed value is Adherence. Usage: .apply()
18 19 20 |
# File 'lib/rfuzzy/rule.rb', line 18 def apply @consequent.call(@antecendent.call) end |