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

The Constant class is a (zero) polynomial Term that represents a constant value \( f(x) = k \). More...

#include <Constant.h>

Inheritance diagram for fl::Constant:
Collaboration diagram for fl::Constant:

Public Member Functions

 Constant (const std::string &name="", scalar value=fl::nan)
 
virtual ~Constant () 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
 Returns 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 setValue (scalar value)
 Sets the constant value. More...
 
virtual scalar getValue () const
 Gets the constant value. More...
 
virtual Constantclone () 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 Constant class is a (zero) polynomial Term that represents a constant value \( f(x) = k \).

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

Definition at line 33 of file Constant.h.

Constructor & Destructor Documentation

◆ Constant()

fl::Constant::Constant ( const std::string &  name = "",
scalar  value = fl::nan 
)
explicit

◆ ~Constant()

virtual fl::Constant::~Constant ( )
virtual

Member Function Documentation

◆ className()

virtual std::string fl::Constant::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 Constant* fl::Constant::clone ( ) const
virtual

Creates a clone of the term.

Returns
a clone of the term

Implements fl::Term.

◆ complexity()

virtual Complexity fl::Constant::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::Constant::configure ( const std::string &  parameters)
virtual

Configures the term with the parameters.

Parameters
parametersas "value"

Implements fl::Term.

◆ constructor()

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

◆ getValue()

virtual scalar fl::Constant::getValue ( ) const
virtual

Gets the constant value.

Returns
the constant value

◆ membership()

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

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

Parameters
xis irrelevant
Returns
\(c\), where \(c\) is the constant value

Implements fl::Term.

◆ parameters()

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

Returns the parameters of the term.

Returns
"value"

Implements fl::Term.

◆ setValue()

virtual void fl::Constant::setValue ( scalar  value)
virtual

Sets the constant value.

Parameters
valueis the constant value

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