rule
Class ContinuousFuzzyRuleVariable

java.lang.Object
  |
  +--rule.FuzzyRuleVariable
        |
        +--rule.ContinuousFuzzyRuleVariable

public class ContinuousFuzzyRuleVariable
extends FuzzyRuleVariable

The ContinuousFuzzyRuleVariable class implements a variable that can hold a continuous value.


Field Summary
(package private)  double discourseHi
           
(package private)  double discourseLo
           
(package private)  java.util.Hashtable setList
           
(package private)  double valCrisp
           
(package private)  WorkingFuzzySet valFzy
           
(package private)  WorkingFuzzySet valFzyTmp
           
(package private)  boolean valKnown
           
 
Fields inherited from class rule.FuzzyRuleVariable
id, name, nextId, rb, type
 
Constructor Summary
(package private) ContinuousFuzzyRuleVariable(FuzzyRuleBase base, java.lang.String name, double discourseLo, double discourseHi)
          Creates a new variable with the specified initial values.
 
Method Summary
(package private)  void addSetShoulder(java.lang.String setName, double alphaCut, double ptBeg, double ptEnd, int setDir)
          Adds the shoulder set.
(package private)  void addSetTrapezoid(java.lang.String setName, double alphaCut, double ptLeft, double ptLeftCore, double ptRightCore, double ptRight)
          Creates a new trapezoid fuzzy set and adds it to this continuous variable.
(package private)  void addSetTriangle(java.lang.String setName, double alphaCut, double ptLeft, double ptCenter, double ptRight)
          Creates a new triangle fuzzy set and adds it to the specified continuous variable.
 double getDiscourseHi()
          Retrieves the high end value of the universe of discourse.
 double getDiscourseLo()
          Retrieves the low end value of the universe of discourse.
 java.util.Hashtable getFuzzySets()
          Retrieves the fuzzy sets.
 FuzzySet getFuzzyValue()
          Retrieves the value of this object as a fuzzy value.
 FuzzySet getFuzzyWorkArea()
          Retrieves the fuzzy work area of this continuous variable.
 double getNumericValue()
          Retrieves the value of this object as a numeric value.
(package private)  FuzzySet getOrAddHedgedSet(java.lang.String setName, java.lang.String hedges)
          Retrieves the named hedged set if it exists or adds it if it does not already exist in the continuous variable.
(package private)  double getRawValue()
          Retrieves the variable's crisp value.
(package private)  FuzzySet getSet(java.lang.String setName)
          Retrieves the fuzzy set that has the given name.
 java.lang.String getSymbolicValue()
          Retrieves the value of this object as a symbolic value.
(package private)  java.lang.String getValueString()
          Retrieves this variable's crisp value as a String.
(package private)  void reset()
          Resets the variable to its intial state.
(package private)  boolean setExist(java.lang.String setName)
          Checks to see if the given set name exists in the list of fuzzy sets for this continuous variable.
 void setFuzzyValue(FuzzySet newValue)
          Sets the value of this object to the given fuzzy value.
(package private)  void setFuzzyValue(FuzzySet newSet, double truthValue)
          Sets the truth value in the new fuzzy set.
 void setNumericValue(double newValue)
          Sets the value of this object to the given numeric value.
(package private)  void setRawValue(double newValue)
          Sets the crisp value of this object to the given numeric value.
(package private)  void setRawValue(FuzzySet newSet)
          Sets the raw value for this variable using the given FuzzySet.
 void setSymbolicValue(java.lang.String newValue)
          Sets the value of this object to the given symbolic value.
 void setValue(FuzzySet newValue)
          Sets the value of this object to the given fuzzy literal value.
(package private)  void setValueString(java.lang.String newValue)
          Sets the crisp value of this variable from the given String.
 java.lang.String toString()
          Returns the name of this variable.
(package private)  boolean withinUniverseOfDiscourse(double value)
          Checks if the given value is within the universe of discourse.
 
Methods inherited from class rule.FuzzyRuleVariable
getId, getName, getReferent, getRuleBase, getType, getTypeAsString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

discourseLo

double discourseLo

discourseHi

double discourseHi

setList

java.util.Hashtable setList

valCrisp

double valCrisp

valFzy

WorkingFuzzySet valFzy

valKnown

boolean valKnown

valFzyTmp

WorkingFuzzySet valFzyTmp
Constructor Detail

ContinuousFuzzyRuleVariable

ContinuousFuzzyRuleVariable(FuzzyRuleBase base,
                            java.lang.String name,
                            double discourseLo,
                            double discourseHi)
Creates a new variable with the specified initial values.
Parameters:
base - the FuzzyRuleBase for this variable
id - the integer identifier for this variable
name - the String that contains the name of this variable
discourseLo - the double that contains the low end of the universe of discourse
discourseHi - the double that contians the high end of the universe of discourse
Method Detail

getFuzzyValue

public FuzzySet getFuzzyValue()
Retrieves the value of this object as a fuzzy value.
Returns:
a FuzzySet, if the value of this object can be represented as a fuzzy value

getNumericValue

public double getNumericValue()
Retrieves the value of this object as a numeric value.
Returns:
a double, if the value of this object can be represented as a numeric value
Overrides:
getNumericValue in class FuzzyRuleVariable

getSymbolicValue

public java.lang.String getSymbolicValue()
Retrieves the value of this object as a symbolic value.
Returns:
a String, if the value of this object can be represented as a symbolic value

setFuzzyValue

public void setFuzzyValue(FuzzySet newValue)
Sets the value of this object to the given fuzzy value.
Parameters:
newValue - the FuzzySet value to which this variable is set
Overrides:
setFuzzyValue in class FuzzyRuleVariable

setNumericValue

public void setNumericValue(double newValue)
Sets the value of this object to the given numeric value.
Parameters:
newValue - the double value to which this variable is set

setSymbolicValue

public void setSymbolicValue(java.lang.String newValue)
Sets the value of this object to the given symbolic value.
Parameters:
newValue - the String value to which this variable is set

setValue

public void setValue(FuzzySet newValue)
Sets the value of this object to the given fuzzy literal value.
Parameters:
newValue - the FuzzyLiteral value to which this variable is set
Overrides:
setValue in class FuzzyRuleVariable

setValueString

void setValueString(java.lang.String newValue)
Sets the crisp value of this variable from the given String.
Parameters:
newValue - the String value from which the crisp value for this variable is set
Overrides:
setValueString in class FuzzyRuleVariable

getValueString

java.lang.String getValueString()
Retrieves this variable's crisp value as a String.
Returns:
the String that represents this variable's crisp value
Overrides:
getValueString in class FuzzyRuleVariable

reset

void reset()
Resets the variable to its intial state.
Overrides:
reset in class FuzzyRuleVariable

getDiscourseLo

public double getDiscourseLo()
Retrieves the low end value of the universe of discourse.
Returns:
the low end value of the universe of discourse

getDiscourseHi

public double getDiscourseHi()
Retrieves the high end value of the universe of discourse.
Returns:
the high end value of the universe of discourse

withinUniverseOfDiscourse

boolean withinUniverseOfDiscourse(double value)
Checks if the given value is within the universe of discourse.
Parameters:
value - the double value to be checked
Returns:
true if the value is within the universe. Otherwise returns false.

setRawValue

void setRawValue(double newValue)
Sets the crisp value of this object to the given numeric value.
Parameters:
newValue - the double value to which this variable is set

getRawValue

double getRawValue()
Retrieves the variable's crisp value.
Returns:
the double which is this variable's crisp value

setRawValue

void setRawValue(FuzzySet newSet)
Sets the raw value for this variable using the given FuzzySet.
Parameters:
newSet - the FuzzySet object that contains the new values

setFuzzyValue

void setFuzzyValue(FuzzySet newSet,
                   double truthValue)
Sets the truth value in the new fuzzy set.
Parameters:
newSet - the FuzzySet object that contains the new set correlated to the truth value
truthValue - the double object that contains the truth value used for correlation

getFuzzySets

public java.util.Hashtable getFuzzySets()
Retrieves the fuzzy sets.
Returns:
the Hashtable object that contains list of fuzzy sets.

getFuzzyWorkArea

public FuzzySet getFuzzyWorkArea()
Retrieves the fuzzy work area of this continuous variable.
Returns:
the FuzzySet object that contains the work area.

setExist

boolean setExist(java.lang.String setName)
Checks to see if the given set name exists in the list of fuzzy sets for this continuous variable.
Parameters:
setName - the String object that contains set name
Returns:
the boolean true if the set name exists or false if it does not exist in the list

getSet

FuzzySet getSet(java.lang.String setName)
Retrieves the fuzzy set that has the given name.
Parameters:
setName - the String object that contains name of the fuzzy set to be retrieved
Returns:
the FuzzySet object with the given name, or null if the set does not exist

getOrAddHedgedSet

FuzzySet getOrAddHedgedSet(java.lang.String setName,
                           java.lang.String hedges)
Retrieves the named hedged set if it exists or adds it if it does not already exist in the continuous variable.
Parameters:
setName - the String object that contains the base set name
hedges - the String object that contains the hedged set name
Returns:
the FuzzySet object that contains the hedged set

addSetShoulder

void addSetShoulder(java.lang.String setName,
                    double alphaCut,
                    double ptBeg,
                    double ptEnd,
                    int setDir)
Adds the shoulder set.
Parameters:
setName - the String object that contains the name of the set to be added
alphaCut - the double value for the alpha cut
ptBeg - the double value for the begin point
ptEnd - the double value for the end point
setDir - the int value for the direction

addSetTrapezoid

void addSetTrapezoid(java.lang.String setName,
                     double alphaCut,
                     double ptLeft,
                     double ptLeftCore,
                     double ptRightCore,
                     double ptRight)
Creates a new trapezoid fuzzy set and adds it to this continuous variable.
Parameters:
setName - the String object that contains the name of the new fuzzy set
alphaCut - the double value for the alpha cut
ptLeft - the double value of the point at which the lower left corner of the trapezoid is placed
ptLeftCore - the double value of the point at which the upper left corner of the trapezoid is placed
ptRightCore - the double value of the point at which the upper right corner of the trapezoid is placed
ptRight - the double value of the point at which the lower right corner of the trapezoid is placed

addSetTriangle

void addSetTriangle(java.lang.String setName,
                    double alphaCut,
                    double ptLeft,
                    double ptCenter,
                    double ptRight)
Creates a new triangle fuzzy set and adds it to the specified continuous variable.
Parameters:
setName - the String object that contains the name of the continuous variable that is to have a new fuzzy set added to it
alphaCut - the double value of the alphacut for the newly created fuzzy set
ptLeft - the double value of the point at which the lower left corner of the triangle is placed
ptCenter - the double value of the point at which the upper point of the triangle is placed
ptRight - the double value of the point at which the lower right corner of the triangle is placed

toString

public java.lang.String toString()
Returns the name of this variable.
Returns:
the String object that contains the name
Overrides:
toString in class FuzzyRuleVariable