rule
Class FuzzyClause

java.lang.Object
  |
  +--rule.FuzzyClause

public class FuzzyClause
extends java.lang.Object

The FuzzyClause class implements a clause with a left-hand side value, an operator, and a righ-hand side value used in both the antecedent and consequent parts of a rule.


Field Summary
(package private)  boolean consequent
           
(package private)  FuzzyRuleVariable lhs
           
(package private)  int op
           
(package private)  FuzzySet rhs
           
 
Constructor Summary
protected FuzzyClause(FuzzyRuleVariable lhs, int op, FuzzySet rhs)
          Creates a new fuzzy clause with the specified lvalue, operator, and rvalue.
 
Method Summary
protected  double eval()
          Evaluates the clause.
protected  double eval(double truthValue)
          Evaluates the clause as a consequent clause.
 FuzzyRuleVariable getLhs()
          Retrieves the left-hand side of the clause.
protected  int getLhsReferent()
          Retrieves the referent from the lhs FuzzyRuleVariable object.
 int getOp()
          Retrieves the operator of the clause.
 java.lang.String getOpAsString()
          Retrieves the operator as a String object.
protected  int getReferent()
          Retrieves the referent from the rhs FuzzySet object.
 FuzzySet getRhs()
          Retrieves the right-hand side of the clause.
protected  int getRhsReferent()
          Retrieves the referent from the rhs FuzzySet object.
 java.lang.String toString()
          Retrieve a string describing the contents of the object.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

lhs

FuzzyRuleVariable lhs

op

int op

rhs

FuzzySet rhs

consequent

boolean consequent
Constructor Detail

FuzzyClause

protected FuzzyClause(FuzzyRuleVariable lhs,
                      int op,
                      FuzzySet rhs)
Creates a new fuzzy clause with the specified lvalue, operator, and rvalue.
Parameters:
lhs - the FuzzyRuleVariable which is the lvalue
op - the integer operator
rhs - the FuzzySet which is the rvalue
Method Detail

eval

protected double eval()
Evaluates the clause.
Returns:
the double value that results from the evaluation of the clause

eval

protected double eval(double truthValue)
Evaluates the clause as a consequent clause.
Parameters:
truthValue - the double value that represents the truth value
Returns:
0.0

getLhs

public FuzzyRuleVariable getLhs()
Retrieves the left-hand side of the clause.
Returns:
the FuzzyRuleVariable object that is the lhs

getOp

public int getOp()
Retrieves the operator of the clause.
Returns:
the int that represents the operator

getOpAsString

public java.lang.String getOpAsString()
Retrieves the operator as a String object.
Returns:
the String object that represents the operator

getRhs

public FuzzySet getRhs()
Retrieves the right-hand side of the clause.
Returns:
the FuzzySet object that is the rhs

getReferent

protected int getReferent()
Retrieves the referent from the rhs FuzzySet object.
Returns:
the integer that represents the referent

getLhsReferent

protected int getLhsReferent()
Retrieves the referent from the lhs FuzzyRuleVariable object.
Returns:
the integer that represents the referent

getRhsReferent

protected int getRhsReferent()
Retrieves the referent from the rhs FuzzySet object.
Returns:
the integer that represents the referent

toString

public java.lang.String toString()
Retrieve a string describing the contents of the object.
Returns:
a String containing the current contents of the object
Overrides:
toString in class java.lang.Object