rule
Class FuzzySet

java.lang.Object
  |
  +--rule.FuzzySet
Direct Known Subclasses:
ShoulderFuzzySet, TrapezoidFuzzySet, TriangleFuzzySet, WorkingFuzzySet

public abstract class FuzzySet
extends java.lang.Object

The FuzzySet class is a abstract class that defines the attributes and methods for a fuzzy set.


Field Summary
protected  double alphaCut
           
protected  double domainHi
           
protected  double domainLo
           
protected  ContinuousFuzzyRuleVariable parentVar
           
protected  java.lang.String setName
           
protected  int setType
           
protected  double[] truthVector
           
 
Constructor Summary
protected FuzzySet(int setType, java.lang.String setName, ContinuousFuzzyRuleVariable parentVar, double alphaCut)
          Creates a new fuzzy set with the given parameters.
protected FuzzySet(int setType, java.lang.String setName, ContinuousFuzzyRuleVariable parentVar, double alphaCut, double domainLo, double domainHi)
          Creates a new fuzzy set with the given parameters.
 
Method Summary
(package private)  boolean aboveAlphaCut(double truthValue)
          Checks if the truth values is above the alpha cut value.
(package private) abstract  void addClone(java.lang.String setName)
          Adds a clone of the given set.
(package private)  void applyAlphaCut()
          Zeroes out truthValues if they are below alphaCut threshold.
(package private)  void applyHedgeConDil(double exp)
          Concentrates or dilutes the fuzzy set.
(package private)  void applyHedges(java.lang.String hedges)
          Uses linguistic hedges to modify fuzzy set.
(package private)  double defuzzify(int defuzzMethod)
          Defuzzifies the set using the given defuzzification method.
 double getAlphaCut()
          Retrieves the alpha cut value.
 double getDomainHi()
          Retrieves the high domain value.
 double getDomainLo()
          Retrieves the low domain value.
 double getNumericValue()
          Retrieve the value of this object as a numeric value.
 int getReferent()
          Retrieve the id of the variable to which this object refers.
(package private)  double getScalar(int index)
          Retrives the scalar for the given index within the domain range.
(package private)  double getSetHeight()
          Finds the truthValue with maximum value between 0.0 and 1.0.
 java.lang.String getSetName()
          Retrieves the name of this fuzzy set.
 int getSetType()
          Retrieves the type of this fuzzy set.
(package private)  double getTruthValue(int index)
          Retrieves a single truth value at the given index.
 double[] getTruthValues()
          Retrieves the truth values for this fuzzy set.
(package private)  double membership(double scalar)
          Retrieves the membership value for the given scalar value.
(package private)  void normalise()
          Adjusts the truthValues so that the max is 1.0.
(package private)  int[] segmentCurve(int numberOfValues, double[] scalarVector, double[] aTruthVector)
          Retrieves the first and last points in a segment curve interpolated from the working truth vector.
 java.lang.String toString()
          Retrieves a string describing the contents of the object.
(package private)  void vectorInterpret(double[] aTruthVector)
          Fills in the bits in the truth vector.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

setType

protected int setType

setName

protected java.lang.String setName

alphaCut

protected double alphaCut

domainLo

protected double domainLo

domainHi

protected double domainHi

truthVector

protected double[] truthVector

parentVar

protected ContinuousFuzzyRuleVariable parentVar
Constructor Detail

FuzzySet

protected FuzzySet(int setType,
                   java.lang.String setName,
                   ContinuousFuzzyRuleVariable parentVar,
                   double alphaCut,
                   double domainLo,
                   double domainHi)
Creates a new fuzzy set with the given parameters.
Parameters:
setType - the integer that represents the set type
setName - the String object that contains the name of the set
parentVar - the ContinuousFuzzyRuleVariable that is the parent of this set
alphaCut - the double value for the alpha cut
domainLo - the double value for the low end of the domain
domainHi - the double value for the high end of the domain

FuzzySet

protected FuzzySet(int setType,
                   java.lang.String setName,
                   ContinuousFuzzyRuleVariable parentVar,
                   double alphaCut)
Creates a new fuzzy set with the given parameters.
Parameters:
setType - the integer that represents the set type
setName - the String object that contains the name of the set
parentVar - the ContinuousFuzzyRuleVariable that is the parent of this set
alphaCut - the double value for the alpha cut
Method Detail

getNumericValue

public double getNumericValue()
Retrieve 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

addClone

abstract void addClone(java.lang.String setName)
Adds a clone of the given set.
Parameters:
setName - the String object that contains the name of the set to be cloned

getReferent

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

getSetType

public int getSetType()
Retrieves the type of this fuzzy set.
Returns:
the integer that represent the set type

getSetName

public java.lang.String getSetName()
Retrieves the name of this fuzzy set.
Returns:
the String object that contains the name

getAlphaCut

public double getAlphaCut()
Retrieves the alpha cut value.
Returns:
the double value for the alpha cut

getDomainLo

public double getDomainLo()
Retrieves the low domain value.
Returns:
the double value for the low end of the domain

getDomainHi

public double getDomainHi()
Retrieves the high domain value.
Returns:
the double value for the high end of the domain

getTruthValues

public double[] getTruthValues()
Retrieves the truth values for this fuzzy set.
Returns:
the double[] of truth values

getTruthValue

double getTruthValue(int index)
Retrieves a single truth value at the given index.
Parameters:
index - the integer value for the index of the truth value
Returns:
the double truth value at the index

applyAlphaCut

void applyAlphaCut()
Zeroes out truthValues if they are below alphaCut threshold.

applyHedges

void applyHedges(java.lang.String hedges)
Uses linguistic hedges to modify fuzzy set.
Parameters:
hedges - the String object that contains the set of hedges

applyHedgeConDil

void applyHedgeConDil(double exp)
Concentrates or dilutes the fuzzy set.
Parameters:
exp - the double value used to concentrate or dilute the fuzzy set

defuzzify

double defuzzify(int defuzzMethod)
Defuzzifies the set using the given defuzzification method.
Parameters:
defuzzMethod - the integer that represent the defuzzification method
Returns:
the double value that is the crisp number

membership

double membership(double scalar)
Retrieves the membership value for the given scalar value.
Parameters:
scalar - the double scalar value
Returns:
the double truth value

aboveAlphaCut

boolean aboveAlphaCut(double truthValue)
Checks if the truth values is above the alpha cut value.
Parameters:
truthValue - the double truth value to be checked
Returns:
the boolean true if truthValue is above alphaCut

normalise

void normalise()
Adjusts the truthValues so that the max is 1.0.

getSetHeight

double getSetHeight()
Finds the truthValue with maximum value between 0.0 and 1.0.
Returns:
the double truth value

getScalar

double getScalar(int index)
Retrives the scalar for the given index within the domain range.
Parameters:
index - the integer value of the index
Returns:
the double scalar value

segmentCurve

int[] segmentCurve(int numberOfValues,
                   double[] scalarVector,
                   double[] aTruthVector)
Retrieves the first and last points in a segment curve interpolated from the working truth vector.
Parameters:
numberOfValues - the integer value for the number of truth values
scalarVector - the double[] scalar vector
aTruthVector - the double[] truth vector
Returns:
the int[] that contains the first and last points of the segment

vectorInterpret

void vectorInterpret(double[] aTruthVector)
Fills in the bits in the truth vector.
Parameters:
aTruthVector - the double[] truth vector

toString

public java.lang.String toString()
Retrieves 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