net.sourceforge.jFuzzyLogic.rule
Class Variable

java.lang.Object
  extended by net.sourceforge.jFuzzyLogic.rule.Variable
All Implemented Interfaces:
java.lang.Comparable

public class Variable
extends java.lang.Object
implements java.lang.Comparable

Fuzzy variable

Author:
pcingola@users.sourceforge.net

Field Summary
(package private)  double defaultValue
          Default value, when no change
(package private)  Defuzzifier defuzzifier
          Defuzzifier class
(package private)  double latestDefuzzifiedValue
          Latest defuzzified value
(package private)  java.util.HashMap<java.lang.String,LinguisticTerm> linguisticTerms
          Terms for this variable
(package private)  java.lang.String name
          Variable name
(package private)  RuleAggregationMethod ruleAggregationMethod
          Rule aggregation method
(package private)  double universeMax
          Universe max (range max)
(package private)  double universeMin
          Universe min (range min)
(package private)  double value
          Variable's value
 
Constructor Summary
Variable(java.lang.String name)
          Default constructor
Variable(java.lang.String name, double universeMin, double universeMax)
          Default constructor
 
Method Summary
 Variable add(LinguisticTerm linguisticTerm)
          Adds a termName to this variable
 Variable add(java.lang.String termName, MembershipFunction membershipFunction)
          Adds a termName to this variable
 org.jfree.chart.JFreeChart chart(boolean showIt)
          Create a chart showing each linguistic term
 org.jfree.chart.JFreeChart chartDefuzzifier(boolean showIt)
          Create a chart showing defuzzifier
 int compareTo(java.lang.Object anotherVariable)
           
 double defuzzify()
          Defuzzify this (output) variable
 void estimateUniverse()
          Estimate unverse
 double getDefaultValue()
           
 Defuzzifier getDefuzzifier()
           
 double getLatestDefuzzifiedValue()
           
 LinguisticTerm getLinguisticTerm(java.lang.String termName)
          Get 'termName' linguistic term
 java.util.HashMap<java.lang.String,LinguisticTerm> getLinguisticTerms()
           
 double getMembership(java.lang.String termName)
          Evaluate 'termName' membershipfunction at 'value'
 MembershipFunction getMembershipFunction(java.lang.String termName)
          Get 'termName' membershipfunction
 java.lang.String getName()
           
 RuleAggregationMethod getRuleAggregationMethod()
           
 double getUniverseMax()
           
 double getUniverseMin()
           
 double getValue()
           
 java.util.Iterator iteratorLinguisticTermNames()
          Get a 'linguisticTerms' iterator (by name)
 java.util.Iterator iteratorLinguisticTermNamesSorted()
          Get a 'linguisticTerms' iterator (by name)
 void reset()
          Reset defuzzifier (if any)
 void setDefaultValue(double defualtValue)
           
 void setDefuzzifier(Defuzzifier deffuzifier)
           
 void setLatestDefuzzifiedValue(double latestDefuzzifiedValue)
           
 void setLinguisticTerms(java.util.HashMap<java.lang.String,LinguisticTerm> linguisticTerms)
           
 void setName(java.lang.String name)
           
 void setRuleAggregationMethod(RuleAggregationMethod ruleAggregationMethod)
           
 void setUniverseMax(double universeMax)
           
 void setUniverseMin(double universeMin)
           
 void setValue(double value)
           
 java.lang.String toString()
          Printable string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

defaultValue

double defaultValue
Default value, when no change


defuzzifier

Defuzzifier defuzzifier
Defuzzifier class


latestDefuzzifiedValue

double latestDefuzzifiedValue
Latest defuzzified value


linguisticTerms

java.util.HashMap<java.lang.String,LinguisticTerm> linguisticTerms
Terms for this variable


name

java.lang.String name
Variable name


ruleAggregationMethod

RuleAggregationMethod ruleAggregationMethod
Rule aggregation method


universeMax

double universeMax
Universe max (range max)


universeMin

double universeMin
Universe min (range min)


value

double value
Variable's value

Constructor Detail

Variable

public Variable(java.lang.String name)
Default constructor

Parameters:
name - : Variable's name

Variable

public Variable(java.lang.String name,
                double universeMin,
                double universeMax)
Default constructor

Parameters:
name - : Variable's name
Method Detail

add

public Variable add(LinguisticTerm linguisticTerm)
Adds a termName to this variable

Parameters:
linguisticTerm - : Linguistic term to add
Returns:
this variable

add

public Variable add(java.lang.String termName,
                    MembershipFunction membershipFunction)
Adds a termName to this variable

Parameters:
termName - : FuzzyRuleTerm name
membershipFunction - : membershipFunction for this termName
Returns:
this variable

chart

public org.jfree.chart.JFreeChart chart(boolean showIt)
Create a chart showing each linguistic term

Parameters:
showIt - : If true, plot is displayed

chartDefuzzifier

public org.jfree.chart.JFreeChart chartDefuzzifier(boolean showIt)
Create a chart showing defuzzifier

Parameters:
showIt - : If true, plot is displayed

compareTo

public int compareTo(java.lang.Object anotherVariable)
Specified by:
compareTo in interface java.lang.Comparable

defuzzify

public double defuzzify()
Defuzzify this (output) variable


estimateUniverse

public void estimateUniverse()
Estimate unverse


getDefaultValue

public double getDefaultValue()

getDefuzzifier

public Defuzzifier getDefuzzifier()

getLatestDefuzzifiedValue

public double getLatestDefuzzifiedValue()

getLinguisticTerm

public LinguisticTerm getLinguisticTerm(java.lang.String termName)
Get 'termName' linguistic term


getLinguisticTerms

public java.util.HashMap<java.lang.String,LinguisticTerm> getLinguisticTerms()

getMembership

public double getMembership(java.lang.String termName)
Evaluate 'termName' membershipfunction at 'value'


getMembershipFunction

public MembershipFunction getMembershipFunction(java.lang.String termName)
Get 'termName' membershipfunction


getName

public java.lang.String getName()

getRuleAggregationMethod

public RuleAggregationMethod getRuleAggregationMethod()

getUniverseMax

public double getUniverseMax()

getUniverseMin

public double getUniverseMin()

getValue

public double getValue()

iteratorLinguisticTermNames

public java.util.Iterator iteratorLinguisticTermNames()
Get a 'linguisticTerms' iterator (by name)


iteratorLinguisticTermNamesSorted

public java.util.Iterator iteratorLinguisticTermNamesSorted()
Get a 'linguisticTerms' iterator (by name)


reset

public void reset()
Reset defuzzifier (if any)


setDefaultValue

public void setDefaultValue(double defualtValue)

setDefuzzifier

public void setDefuzzifier(Defuzzifier deffuzifier)

setLatestDefuzzifiedValue

public void setLatestDefuzzifiedValue(double latestDefuzzifiedValue)

setLinguisticTerms

public void setLinguisticTerms(java.util.HashMap<java.lang.String,LinguisticTerm> linguisticTerms)

setName

public void setName(java.lang.String name)

setRuleAggregationMethod

public void setRuleAggregationMethod(RuleAggregationMethod ruleAggregationMethod)

setUniverseMax

public void setUniverseMax(double universeMax)

setUniverseMin

public void setUniverseMin(double universeMin)

setValue

public void setValue(double value)

toString

public java.lang.String toString()
Printable string

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()