Class: Rule

Inherits:
Object
  • Object
show all
Defined in:
lib/rfuzzy/rule.rb

Overview

Represents the Rule for FuzzySystem where both antescendent and consequent are Proc objects

Instance Method Summary collapse

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

#applyObject

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