net.sourceforge.jFuzzyLogic.rule
Class FuzzyRule

java.lang.Object
  extended by net.sourceforge.jFuzzyLogic.rule.FuzzyRule

public class FuzzyRule
extends java.lang.Object

Fuzzy rule Rule: If (x1 is termX1) AND (x2 is termX2) .... Then (y1 is termY1) AND (y2 is termY2) [weight: 1.0] Notes: - "If" clause is called "antecedent" - "then" clause is called "consequent" - There may be 1 or more antecedents connected using a 'RuleConnectionMethod' (e.g. AND, OR) - As there are many ways to implement 'AND' and 'OR' connectors, you can customize them

Author:
pcingola@users.sourceforge.net

Field Summary
(package private)  FuzzyRuleExpression antecedents
          Rule antecedent ('if' part)
(package private)  java.util.LinkedList<FuzzyRuleTerm> consequents
          Rule consequent ('then' part)
(package private)  double degreeOfSupport
          Degree of support
(package private)  java.lang.String name
          Rule's name
(package private)  double weight
          Rule's weight
 
Constructor Summary
FuzzyRule(java.lang.String name)
          Default constructor Default weight: 1.0 Default connection method: AND (minimum)
 
Method Summary
 FuzzyRule addAntecedent(Variable variable, java.lang.String termName, boolean negated)
          Add a condition "...
 FuzzyRule addConsequent(Variable variable, java.lang.String termName, boolean negated)
          Add consequent "( variable is termName)" to this rule
 void evaluate(RuleImplicationMethod ruleImplicationMethod)
          Evaluate this rule using 'RuleImplicationMethod'
 FuzzyRuleExpression getAntecedents()
           
 java.util.LinkedList<FuzzyRuleTerm> getConsequents()
           
 double getDegreeOfSupport()
           
 java.lang.String getName()
           
 double getWeight()
           
 void setAntecedents(FuzzyRuleExpression antecedents)
           
 void setConsequents(java.util.LinkedList<FuzzyRuleTerm> consequents)
           
 void setDegreeOfSupport(double degreeOfSupport)
           
 void setName(java.lang.String name)
           
 void setWeight(double weight)
           
 java.lang.String toString()
           
 java.lang.String toStringFCL()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

antecedents

FuzzyRuleExpression antecedents
Rule antecedent ('if' part)


consequents

java.util.LinkedList<FuzzyRuleTerm> consequents
Rule consequent ('then' part)


degreeOfSupport

double degreeOfSupport
Degree of support


name

java.lang.String name
Rule's name


weight

double weight
Rule's weight

Constructor Detail

FuzzyRule

public FuzzyRule(java.lang.String name)
Default constructor Default weight: 1.0 Default connection method: AND (minimum)

Method Detail

addAntecedent

public FuzzyRule addAntecedent(Variable variable,
                               java.lang.String termName,
                               boolean negated)
Add a condition "... AND ( variable is termName)" to this rule

Parameters:
variable - : Variable to evaluate
termName - : FuzzyRuleTerm for this condition
Returns:
this FuzzyRule

addConsequent

public FuzzyRule addConsequent(Variable variable,
                               java.lang.String termName,
                               boolean negated)
Add consequent "( variable is termName)" to this rule

Parameters:
variable - : Variable to evaluate
termName - : FuzzyRuleTerm for this condition
Returns:
this FuzzyRule

evaluate

public void evaluate(RuleImplicationMethod ruleImplicationMethod)
Evaluate this rule using 'RuleImplicationMethod'

Parameters:
ruleImplicationMethod - : Rule implication method to use

getAntecedents

public FuzzyRuleExpression getAntecedents()

getConsequents

public java.util.LinkedList<FuzzyRuleTerm> getConsequents()

getDegreeOfSupport

public double getDegreeOfSupport()

getName

public java.lang.String getName()

getWeight

public double getWeight()

setAntecedents

public void setAntecedents(FuzzyRuleExpression antecedents)

setConsequents

public void setConsequents(java.util.LinkedList<FuzzyRuleTerm> consequents)

setDegreeOfSupport

public void setDegreeOfSupport(double degreeOfSupport)

setName

public void setName(java.lang.String name)

setWeight

public void setWeight(double weight)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toStringFCL

public java.lang.String toStringFCL()