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...
 

Protected Attributes

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.

terms.svg
Author
Juan Rada-Vilela, Ph.D.
See also
Variable
InputVariable
OutputVariable
Since
4.0

Definition at line 55 of file Term.h.

Constructor & Destructor Documentation

◆ Term()

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

◆ ~Term()

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

Member Function Documentation

◆ className()

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

◆ clone()

◆ 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

Implemented in fl::Function, fl::Discrete, fl::Aggregated, fl::Binary, fl::Sigmoid, fl::Ramp, fl::GaussianProduct, fl::PiShape, fl::Linear, fl::SigmoidDifference, fl::SigmoidProduct, fl::Activated, fl::Bell, fl::Triangle, fl::Gaussian, fl::Trapezoid, fl::ZShape, fl::Cosine, fl::Rectangle, fl::SShape, fl::Concave, fl::Spike, and fl::Constant.

◆ 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
parametersis the parameters to configure the term

Implemented in fl::Function, fl::Aggregated, fl::Binary, fl::Sigmoid, fl::Ramp, fl::Discrete, fl::GaussianProduct, fl::PiShape, fl::Linear, fl::SigmoidDifference, fl::SigmoidProduct, fl::Activated, fl::Bell, fl::Triangle, fl::Gaussian, fl::Trapezoid, fl::ZShape, fl::Cosine, fl::Rectangle, fl::SShape, fl::Concave, fl::Spike, and fl::Constant.

◆ 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

◆ 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 (
See also
Term::configure())

Implemented in fl::Function, fl::Aggregated, fl::Binary, fl::Sigmoid, fl::Ramp, fl::Discrete, fl::GaussianProduct, fl::Linear, fl::PiShape, fl::SigmoidDifference, fl::SigmoidProduct, fl::Activated, fl::Bell, fl::Triangle, fl::Gaussian, fl::Trapezoid, fl::ZShape, fl::Cosine, fl::Rectangle, fl::SShape, fl::Concave, fl::Spike, and fl::Constant.

◆ setHeight()

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

Sets the height of the term.

Parameters
heightis the height of the term

◆ setName()

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

Sets the name of the term.

Parameters
nameis 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
See also
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
engineis the engine to which this term belongs to

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

Member Data Documentation

◆ _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: