fuzzylite  6.0
A Fuzzy Logic Control Library in C++
fl::GaussianProduct Class Reference

The GaussianProduct class is an extended Term that represents the two-sided Gaussian membership function. More...

#include <GaussianProduct.h>

Inheritance diagram for fl::GaussianProduct:
Collaboration diagram for fl::GaussianProduct:

Public Member Functions

 GaussianProduct (const std::string &name="", scalar meanA=fl::nan, scalar standardDeviationA=fl::nan, scalar meanB=fl::nan, scalar standardDeviationB=fl::nan, scalar height=1.0)
 
virtual ~GaussianProduct () FL_IOVERRIDE
 
virtual std::string className () const FL_IOVERRIDE
 Returns the name of the class of the term. More...
 
virtual std::string parameters () const FL_IOVERRIDE
 Provides the parameters of the term. More...
 
virtual void configure (const std::string &parameters) FL_IOVERRIDE
 Configures the term with the parameters. More...
 
virtual Complexity complexity () const FL_IOVERRIDE
 Computes the estimated complexity of evaluating the membership function. More...
 
virtual scalar membership (scalar x) const FL_IOVERRIDE
 Computes the membership function evaluated at \(x\). More...
 
virtual void setMeanA (scalar meanA)
 Sets the mean of the first Gaussian curve. More...
 
virtual scalar getMeanA () const
 Gets the mean of the first Gaussian curve. More...
 
virtual void setStandardDeviationA (scalar standardDeviationA)
 Sets the standard deviation of the first Gaussian curve. More...
 
virtual scalar getStandardDeviationA () const
 Gets the standard deviation of the first Gaussian curve. More...
 
virtual void setMeanB (scalar meanB)
 Sets the mean of the second Gaussian curve. More...
 
virtual scalar getMeanB () const
 Gets the mean of the second Gaussian curve. More...
 
virtual void setStandardDeviationB (scalar standardDeviationB)
 Sets the standard deviation of the second Gaussian curve. More...
 
virtual scalar getStandardDeviationB () const
 Gets the standard deviation of the second Gaussian curve. More...
 
virtual GaussianProductclone () const FL_IOVERRIDE
 Creates a clone of the term. More...
 
- Public Member Functions inherited from fl::Term
 Term (const std::string &name="", scalar height=1.0)
 
virtual ~Term ()
 
virtual void setName (const std::string &name)
 Sets the name of the term. More...
 
virtual std::string getName () const
 Gets the name of the term. More...
 
virtual void setHeight (scalar height)
 Sets the height of the term. More...
 
virtual scalar getHeight () const
 Gets the height of the term. More...
 
virtual std::string toString () const
 Returns the representation of the term in the FuzzyLite Language. More...
 
virtual void updateReference (const Engine *engine)
 Updates the references (if any) to point to the current engine (useful when cloning engines or creating terms within Importer objects. More...
 

Static Public Member Functions

static Termconstructor ()
 

Additional Inherited Members

- Protected Attributes inherited from fl::Term
scalar _height
 

Detailed Description

The GaussianProduct class is an extended Term that represents the two-sided Gaussian membership function.

gaussianProduct.svg
Author
Juan Rada-Vilela, Ph.D.
See also
Term
Variable
Since
4.0

Definition at line 35 of file GaussianProduct.h.

Constructor & Destructor Documentation

◆ GaussianProduct()

fl::GaussianProduct::GaussianProduct ( const std::string &  name = "",
scalar  meanA = fl::nan,
scalar  standardDeviationA = fl::nan,
scalar  meanB = fl::nan,
scalar  standardDeviationB = fl::nan,
scalar  height = 1.0 
)
explicit

◆ ~GaussianProduct()

virtual fl::GaussianProduct::~GaussianProduct ( )
virtual

Member Function Documentation

◆ className()

virtual std::string fl::GaussianProduct::className ( ) const
virtual

Returns the name of the class of the term.

Returns
the name of the class of the term

Implements fl::Term.

◆ clone()

virtual GaussianProduct* fl::GaussianProduct::clone ( ) const
virtual

Creates a clone of the term.

Returns
a clone of the term

Implements fl::Term.

◆ complexity()

virtual Complexity fl::GaussianProduct::complexity ( ) const
virtual

Computes the estimated complexity of evaluating the membership function.

Returns
the estimated complexity of evaluating the membership function

Implements fl::Term.

◆ configure()

virtual void fl::GaussianProduct::configure ( const std::string &  parameters)
virtual

Configures the term with the parameters.

Parameters
parametersas "meanA standardDeviationA meanB standardDeviationB [height]"

Implements fl::Term.

◆ constructor()

static Term* fl::GaussianProduct::constructor ( )
static

◆ getMeanA()

virtual scalar fl::GaussianProduct::getMeanA ( ) const
virtual

Gets the mean of the first Gaussian curve.

Returns
the mean of the first Gaussian curve

◆ getMeanB()

virtual scalar fl::GaussianProduct::getMeanB ( ) const
virtual

Gets the mean of the second Gaussian curve.

Returns
the mean of the second Gaussian curve

◆ getStandardDeviationA()

virtual scalar fl::GaussianProduct::getStandardDeviationA ( ) const
virtual

Gets the standard deviation of the first Gaussian curve.

Returns
the standard deviation of the first Gaussian curve

◆ getStandardDeviationB()

virtual scalar fl::GaussianProduct::getStandardDeviationB ( ) const
virtual

Gets the standard deviation of the second Gaussian curve.

Returns
the standard deviation of the second Gaussian curve

◆ membership()

virtual scalar fl::GaussianProduct::membership ( scalar  x) const
virtual

Computes the membership function evaluated at \(x\).

Parameters
x
Returns
\( h \left((1 - i) + i \times \exp(-(x - \mu_a)^2 / (2\sigma_a^2))\right) \left((1 - j) + j \times \exp(-(x - \mu_b)^2 / (2 \sigma_b)^2)\right) \)

where \(h\) is the height of the Term, \(\mu_a\) is the mean of the first GaussianProduct, \(\sigma_a\) is the standard deviation of the first GaussianProduct, \(\mu_b\) is the mean of the second GaussianProduct, \(\sigma_b\) is the standard deviation of the second GaussianProduct, \(i=\begin{cases}1 & \mbox{if $x \leq \mu_a$} \cr 0 &\mbox{otherwise}\end{cases}\), \(j=\begin{cases}1 & \mbox{if $x \geq \mu_b$} \cr 0 &\mbox{otherwise}\end{cases}\)

Implements fl::Term.

◆ parameters()

virtual std::string fl::GaussianProduct::parameters ( ) const
virtual

Provides the parameters of the term.

Returns
"meanA standardDeviationA meanB standardDeviationB [height]"

Implements fl::Term.

◆ setMeanA()

virtual void fl::GaussianProduct::setMeanA ( scalar  meanA)
virtual

Sets the mean of the first Gaussian curve.

Parameters
meanAis the mean of the first Gaussian curve

◆ setMeanB()

virtual void fl::GaussianProduct::setMeanB ( scalar  meanB)
virtual

Sets the mean of the second Gaussian curve.

Parameters
meanBis the mean of the second Gaussian curve

◆ setStandardDeviationA()

virtual void fl::GaussianProduct::setStandardDeviationA ( scalar  standardDeviationA)
virtual

Sets the standard deviation of the first Gaussian curve.

Parameters
standardDeviationAis the standard deviation of the first Gaussian curve

◆ setStandardDeviationB()

virtual void fl::GaussianProduct::setStandardDeviationB ( scalar  standardDeviationB)
virtual

Sets the standard deviation of the second Gaussian curve.

Parameters
standardDeviationBis the standard deviation of the second Gaussian curve

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