FuzzySet Class Reference

Abstract super class for specific fuzzy sets. More...

#include <FuzzySet.h>

Inheritance diagram for FuzzySet:

RCObject BellFS ComposedFS ConstantFS CustomizedFS GeneralizedBellFS InfinityFS LinguisticTerm SigmoidalFS SingletonFS TrapezoidFS TriangularFS

List of all members.

Public Member Functions

 FuzzySet (double scale=1.0)
 Constructor.
virtual ~FuzzySet ()
 Destructor.
double operator() (double x) const
 The membership function.
void scale (double factor)
 Rescales the membership function.
virtual double defuzzify (double lowerBound=-std::numeric_limits< double >::max(), double upperBound=std::numeric_limits< double >::max(), double errRel=ERR_RELATIVE, int recursionMax=RECURSION_MAX) const
 Defuzzification by centroid method.
virtual double defuzzifyMax (unsigned int steps=100, double low=-std::numeric_limits< double >::max(), double high=std::numeric_limits< double >::max()) const
 Defuzzification by Smallest-of-Maximum (SOM) method.
virtual void makeGNUPlotData (const std::string fileName="mf.dat", unsigned int steps=100) const
 Writes gnuplot suited data into a file.
virtual void makeGNUPlotData (const std::string fileName, unsigned int steps, double lowerBound, double upperBound) const
 Writes gnuplot suited data into a file.
virtual double getMin () const =0
 Returns the lower boundary of the support.
virtual double getMax () const =0
 Returns the upper boundary of the support.


Detailed Description

Abstract super class for specific fuzzy sets.

Definition at line 38 of file FuzzySet.h.


Constructor & Destructor Documentation

FuzzySet::FuzzySet ( double  scale = 1.0  ) 

Constructor.

Parameters:
scale scaling factor for the membership function

Definition at line 29 of file FuzzySet.cpp.

FuzzySet::~FuzzySet (  )  [virtual]

Destructor.

Definition at line 31 of file FuzzySet.cpp.


Member Function Documentation

double FuzzySet::defuzzify ( double  lowerBound = -std::numeric_limits<double>::max(),
double  upperBound = std::numeric_limits<double>::max(),
double  errRel = ERR_RELATIVE,
int  recursionMax = RECURSION_MAX 
) const [virtual]

Defuzzification by centroid method.

This method defuzzifies the fuzzy set by determining the value of the abscissa of the centre of gravity of the area below the membership function:

\[ x_0 = \frac{ \int x\mu(x)\,dx }{ \int \mu(x)\,dx } \]

Parameters:
lowerBound lower bound for defuzzification interval
upperBound upper bound for defuzzification interval
errRel relative approximation error that is tollerated during numerical integration
recursionMax max. depth of recursion during numerical integration (i.e. max. $2^n$ steps)

Definition at line 71 of file FuzzySet.cpp.

Referenced by LinguisticTerm::defuzzify(), and BellLT::defuzzify().

double FuzzySet::defuzzifyMax ( unsigned int  steps = 100,
double  low = -std::numeric_limits<double>::max(),
double  high = std::numeric_limits<double>::max() 
) const [virtual]

Defuzzification by Smallest-of-Maximum (SOM) method.

This method defuzzifies the fuzzy set by searching for the point (in the given interval) where the membership functions reaches its maximum. If this maximum isn't unique, the first one will be taken.

Parameters:
steps number of equally distributed points the membership function will be evaluated at
low lower bound for defuzzification interval
high upper bound for defuzzification interval

Definition at line 91 of file FuzzySet.cpp.

References getMax(), getMin(), and operator()().

double FuzzySet::getMax (  )  const [pure virtual]

Returns the upper boundary of the support.

Returns:
the max. value for which the membership function is nonzero (or exceeds a given threshold)

Implemented in BellFS, BellLT, ComposedFS, ComposedLT, ConstantFS, ConstantLT, CustomizedFS, CustomizedLT, GeneralizedBellFS, GeneralizedBellLT, InfinityFS, InfinityLT, SigmoidalFS, SigmoidalLT, SingletonFS, SingletonLT, TrapezoidFS, TrapezoidLT, TriangularFS, and TriangularLT.

Definition at line 127 of file FuzzySet.cpp.

Referenced by defuzzifyMax(), and makeGNUPlotData().

double FuzzySet::getMin (  )  const [pure virtual]

Returns the lower boundary of the support.

Returns:
the min. value for which the membership function is nonzero (or exceeds a given threshold)

Implemented in BellFS, BellLT, ComposedFS, ComposedLT, ConstantFS, ConstantLT, CustomizedFS, CustomizedLT, GeneralizedBellFS, GeneralizedBellLT, InfinityFS, InfinityLT, SigmoidalFS, SigmoidalLT, SingletonFS, SingletonLT, TrapezoidFS, TrapezoidLT, TriangularFS, and TriangularLT.

Definition at line 124 of file FuzzySet.cpp.

Referenced by defuzzifyMax(), and makeGNUPlotData().

void FuzzySet::makeGNUPlotData ( const std::string  fileName,
unsigned int  steps,
double  lowerBound,
double  upperBound 
) const [virtual]

Writes gnuplot suited data into a file.

This function writes the membership function into a gnuplot suited data file. Only the specified range is considered.

Parameters:
fileName name of the outputfile (existing files will be overwritten)
steps number of sampling points
lowerBound lower bound of plotting interval
upperBound upper bound of plotting interval

Definition at line 41 of file FuzzySet.cpp.

References operator()().

void FuzzySet::makeGNUPlotData ( const std::string  fileName = "mf.dat",
unsigned int  steps = 100 
) const [virtual]

Writes gnuplot suited data into a file.

This function writes the membership function into a gnuplot suited data file. Only the range where the membership function is nonzero or above a given threshold is considered. If the support of the membership function is not limited, we assume the limits of the data type double.

Parameters:
fileName name of the outputfile (existing files will be overwritten)
steps number of sampling points

Definition at line 65 of file FuzzySet.cpp.

References getMax(), and getMin().

double FuzzySet::operator() ( double  x  )  const [inline]

The membership function.

If fs is a FuzzySet, fs( x ) returns the value of the membership function (the $\mu$-function) at point x.

Definition at line 59 of file FuzzySet.h.

Referenced by defuzzifyMax(), and makeGNUPlotData().

void FuzzySet::scale ( double  factor  )  [inline]

Rescales the membership function.

Note: This doesn't set a new scaling factor but scales the current one by the given factor.

Parameters:
factor factor for rescaling

Definition at line 71 of file FuzzySet.h.


The documentation for this class was generated from the following files: