fuzzylite  6.0 A Fuzzy Logic Control Library in C++
fl::Term Class Referenceabstract

The Term class is the abstract class for linguistic terms. More...

#include <Term.h>

Inheritance diagram for fl::Term:
Collaboration diagram for fl::Term:

## Public Member Functions

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 std::string className () const =0
Returns the name of the class of the term. More...

virtual std::string parameters () const =0
Returns the parameters to configure the term. More...

virtual void configure (const std::string &parameters)=0
Configures the term with the given parameters. More...

virtual Complexity complexity () const =0
Computes the estimated complexity of evaluating the membership function. More...

virtual scalar membership (scalar x) const =0
Computes the membership function value at $$x$$. More...

virtual Termclone () const =0
Creates a clone of the term. 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...

scalar _height

## Detailed Description

The Term class is the abstract class for linguistic terms.

The linguistic terms in this library can be divided in four groups as: basic, extended, edge, and function. The basic terms are Triangle, Trapezoid, Rectangle, and Discrete. The extended terms are Bell, Binary, Cosine, Gaussian, GaussianProduct, PiShape, SigmoidDifference, SigmoidProduct, and Spike. The edge terms are Concave, Ramp, Sigmoid, SShape, and ZShape. The function terms are Constant, Linear, and Function.

In the figure below, the basic terms are represented in the first column, and the extended terms in the second and third columns. The edge terms are represented in the fifth and sixth rows, and the function terms in the last row.

Variable
InputVariable
OutputVariable
Since
4.0

Definition at line 55 of file Term.h.

## ◆ Term()

 fl::Term::Term ( const std::string & name = "", scalar height = 1.0 )
explicit

## ◆ ~Term()

 virtual fl::Term::~Term ( )
virtual

## ◆ className()

 virtual std::string fl::Term::className ( ) const
pure virtual

Returns the name of the class of the term.

Returns
the name of the class of the term

## ◆ clone()

 virtual Term* fl::Term::clone ( ) const
pure virtual

Creates a clone of the term.

Returns
a clone of the term

## ◆ complexity()

 virtual Complexity fl::Term::complexity ( ) const
pure virtual

Computes the estimated complexity of evaluating the membership function.

Returns
the estimated complexity of evaluating the membership function

## ◆ configure()

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

Configures the term with the given parameters.

The parameters are separated by spaces. If there is one additional parameter, the parameter will be considered as the height of the term; otherwise, the height will be set to $$1.0$$

Parameters
 parameters is the parameters to configure the term

## ◆ getHeight()

 virtual scalar fl::Term::getHeight ( ) const
virtual

Gets the height of the term.

Returns
the height of the term

## ◆ getName()

 virtual std::string fl::Term::getName ( ) const
virtual

Gets the name of the term.

Returns
the name of the term

## ◆ membership()

 virtual scalar fl::Term::membership ( scalar x ) const
pure virtual

Computes the membership function value at $$x$$.

Parameters
 x
Returns
the membership function value $$\mu(x)$$

## ◆ parameters()

 virtual std::string fl::Term::parameters ( ) const
pure virtual

Returns the parameters to configure the term.

The parameters are separated by spaces. If there is one additional parameter, the parameter will be considered as the height of the term; otherwise, the height will be set to $$1.0$$

Returns
the parameters to configure the term (
Term::configure())

## ◆ setHeight()

 virtual void fl::Term::setHeight ( scalar height )
virtual

Sets the height of the term.

Parameters
 height is the height of the term

## ◆ setName()

 virtual void fl::Term::setName ( const std::string & name )
virtual

Sets the name of the term.

Parameters
 name is the name of term

## ◆ toString()

 virtual std::string fl::Term::toString ( ) const
virtual

Returns the representation of the term in the FuzzyLite Language.

Returns
the representation of the term in FuzzyLite Language
FllExporter

Reimplemented in fl::Aggregated, and fl::Activated.

## ◆ updateReference()

 virtual void fl::Term::updateReference ( const Engine * engine )
virtual

Updates the references (if any) to point to the current engine (useful when cloning engines or creating terms within Importer objects.

Parameters
 engine is the engine to which this term belongs to

Reimplemented in fl::Function, and fl::Linear.

## ◆ _height

 scalar fl::Term::_height
protected

Definition at line 59 of file Term.h.

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