org.sazonov.fuzzy.engine
Class LinguisticVariable

java.lang.Object
  extended byorg.sazonov.fuzzy.engine.LinguisticVariable

public class LinguisticVariable
extends java.lang.Object

Class for linguistic variables.

Version:
2000 Original, v0.1, Edward S. Sazonov (esazonov@usa.com), 12/19/2003 Modifications, v0.2, Nazario Irizarry (naz-irizarry@excite.com)

Method Summary
 void add(MembershipFunction mFunction)
          Add a membership function.
 void add(java.lang.String name, double start, double left_top, double right_top, double finish)
          Add a membership function given by its name and trapezoidal region.
 LinguisticVariable copy(java.lang.String name)
          Return an copy of itself with a different name.
 double defuzzify()
          Defuzzify using centroid.
 MembershipFunction getMembershipFunctionByName(java.lang.String name)
          Return a MembershipFunction belonging to this LinguisticVariable by its name.
 java.lang.String getName()
          Return the name of this linguistic variable
 void reset()
          Reset all rules that have previously fired for this LinguisticVariable.
 void setInputValue(double value)
          Set input value for this lingustic variable.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

add

public void add(MembershipFunction mFunction)
Add a membership function.

Parameters:
mFunction - MembershipFunction to be added.

add

public void add(java.lang.String name,
                double start,
                double left_top,
                double right_top,
                double finish)
Add a membership function given by its name and trapezoidal region.

Parameters:
name - Name of the membership function.
start - Min support value.
left_top - Min top value.
right_top - Max top value.
finish - Max support value.

copy

public LinguisticVariable copy(java.lang.String name)
Return an copy of itself with a different name. The copy is exact except that rules fired since the last reset() will not influence defuzzification result.

Parameters:
name - the name of the copy
Returns:
engine.LinguisticVariable

defuzzify

public double defuzzify()
                 throws NoRulesFiredException
Defuzzify using centroid. Memebership functions are scaled by product and combined by summation. This method has to be completely redone (eliminated operations on discrete array, support different modes of scaling and summation).

Returns:
double Result of defuzzification
Throws:
fuzzyEngine.NoRulesFiredException - This exception is thrown if no rules have fired for this Linguistic Variable.
NoRulesFiredException

getName

public java.lang.String getName()
Return the name of this linguistic variable

Returns:
java.lang.String

getMembershipFunctionByName

public MembershipFunction getMembershipFunctionByName(java.lang.String name)
Return a MembershipFunction belonging to this LinguisticVariable by its name.

Parameters:
name - java.lang.String Name of the membership function.
Returns:
MemebershipFunction

reset

public void reset()
Reset all rules that have previously fired for this LinguisticVariable.


setInputValue

public void setInputValue(double value)
Set input value for this lingustic variable.

Parameters:
value - double