Class FuzzyOutput
A fuzzy output variable: member functions keyed by consequent, defuzzified with the centroid method.
public sealed class FuzzyOutput
- Inheritance
-
FuzzyOutput
- Inherited Members
Remarks
Rules attach their conditions to the output's consequents, so the output holds the rule set. Build a new output (and its rules) per rule set; an output is not safe to share across threads.
Methods
Evaluate()
Evaluates all rules attached to this output and defuzzifies the result.
public double Evaluate()
Returns
- double
The crisp output value, or 0 when no rule is active.
Is(int)
Gets the consequent for consequent, to be used with Then(IConsequent).
public IConsequent Is(int consequent)
Parameters
consequentintThe key of the consequent.
Returns
- IConsequent
The consequent.
Exceptions
- KeyNotFoundException
Thrown when
consequentis not set.
Set(int, IHasCentroid)
Sets the member function for consequent.
public void Set(int consequent, IHasCentroid memberFunction)
Parameters
consequentintThe key of the consequent, e.g. a constant for "high".
memberFunctionIHasCentroidThe member function of the consequent.
Exceptions
- ArgumentException
Thrown when
consequentis already set.