rule
Class FuzzyRuleVariable

java.lang.Object
  |
  +--rule.FuzzyRuleVariable
Direct Known Subclasses:
ContinuousFuzzyRuleVariable

public abstract class FuzzyRuleVariable
extends java.lang.Object

The FuzzyRuleVariable class is a abstract class that defines the attributes and methods for a fuzzy rule variable.


Field Summary
protected  int id
           
protected  java.lang.String name
           
(package private) static int nextId
           
protected  FuzzyRuleBase rb
           
protected  int type
           
 
Constructor Summary
protected FuzzyRuleVariable(int type, FuzzyRuleBase rb, java.lang.String name)
          Creates a new fuzzy variable with the given type, rule base, and name.
 
Method Summary
 int getId()
          Retrieves the id of the variable.
 java.lang.String getName()
          Retrieves the variable name.
abstract  double getNumericValue()
          Retrieves the value of this object as a numeric value.
 int getReferent()
          Retrieves the id of the variable to which this object refers.
(package private)  FuzzyRuleBase getRuleBase()
          Retrieve the rule base this variable is a part of.
 int getType()
          Retrieves the type of this object.
 java.lang.String getTypeAsString()
          Retrives the variable type as a string.
(package private) abstract  java.lang.String getValueString()
          Retrieves the value string of this variable.
(package private) abstract  void reset()
          Resets the variable.
abstract  void setFuzzyValue(FuzzySet newValue)
          Sets the value of this object from a fuzzy value.
abstract  void setValue(FuzzySet newValue)
          Sets the value of this object from a FuzzySet object.
(package private) abstract  void setValueString(java.lang.String newValue)
          Sets the value string of the variable.
 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

nextId

static int nextId

type

protected int type

id

protected int id

name

protected java.lang.String name

rb

protected FuzzyRuleBase rb
Constructor Detail

FuzzyRuleVariable

protected FuzzyRuleVariable(int type,
                            FuzzyRuleBase rb,
                            java.lang.String name)
Creates a new fuzzy variable with the given type, rule base, and name.
Parameters:
type - the integer that represent the type of the variable
rb - the FuzzyRuleBase object this variable is a part of
name - the String object that contains the name of the variable
Method Detail

getReferent

public int getReferent()
Retrieves the id of the variable to which this object refers.
Returns:
the id of the variable to which this value refers

getType

public int getType()
Retrieves the type of this object.
Returns:
the integer that represents the type of the variable

setValueString

abstract void setValueString(java.lang.String newValue)
Sets the value string of the variable.
Parameters:
newValue - the String object that is the value of this variable

getValueString

abstract java.lang.String getValueString()
Retrieves the value string of this variable.
Returns:
the String object that contains the value

reset

abstract void reset()
Resets the variable.

getTypeAsString

public java.lang.String getTypeAsString()
Retrives the variable type as a string.
Returns:
the String object that represents the variable type

getId

public int getId()
Retrieves the id of the variable.
Returns:
the integer that represents the variable id

getName

public java.lang.String getName()
Retrieves the variable name.
Returns:
the String object that contains the name

getRuleBase

FuzzyRuleBase getRuleBase()
Retrieve the rule base this variable is a part of.
Returns:
the FuzzyRuleBase object this variable belongs to

setFuzzyValue

public abstract void setFuzzyValue(FuzzySet newValue)
Sets the value of this object from a fuzzy value.
Parameters:
newValue - the FuzzySet object that this variable is set to

setValue

public abstract void setValue(FuzzySet newValue)
Sets the value of this object from a FuzzySet object.
Parameters:
newValue - the FuzzySet object that contains the new value

getNumericValue

public abstract 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

toString

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