Fuzzy Logic Tools
v1.0.5.1
|
This class contains methods and attributes common to all Membership functions. More...
#include <membership.hpp>
Public Member Functions | |
virtual double | eval (double x) const =0 |
Evaluates the Membership function. More... | |
virtual double | evalder (double x) const =0 |
Evaluates the derivative of the Membership function with respect to x, ![]() | |
virtual double | paramder (size_t parameter, double x) const =0 |
Evaluates the derivative of the Membership function with respect to a parameter, ![]() | |
virtual int | test (void) const |
This function checks parameters in the Membership function, and corrects them if possible. More... | |
size_t | num_params (void) const |
Reads the number of parameters that define the Membership function. More... | |
TYPE_MF | type (void) const |
Returns the type of Membership function. More... | |
int | type (TYPE_MF type_mf) |
Changes the Membership function type. More... | |
int | edit (size_t index, double value) |
Changes a parameter. More... | |
void | edit (const double *const parameters) |
Changes the vector of parameters. More... | |
double | read (size_t index) const |
Reads a parameter of the Membership function. More... | |
TNT::Array1D< double > | read (void) const |
Returns the vector of parameters. | |
Membership & | operator= (const Membership &P) |
Membership (const Membership &P) | |
Protected Attributes | |
double * | param |
Vector of parameters that define the Membership function. | |
size_t | n |
Number of parameters of the Membership function. | |
TYPE_MF | type_mf |
Type of Membership function. | |
This class contains methods and attributes common to all Membership functions.
This class can store the type of Membership function and all its parameters and evaluates the function and its derivatives.
int Membership::edit | ( | size_t | index, |
double | value | ||
) |
Changes a parameter.
void Membership::edit | ( | const double *const | parameters | ) |
Changes the vector of parameters.
|
pure virtual |
Evaluates the Membership function.
Implemented in FLT::Zmf, FLT::Trimf, FLT::Trapmf, FLT::Sig2mf, FLT::Sigmf, FLT::Smf, FLT::PSigmf, FLT::Pimf, FLT::GBellmf, FLT::Gauss2mf, FLT::Gaussmf, FLT::Constmf, and FLT::Anymf.
|
pure virtual |
Evaluates the derivative of the Membership function with respect to x, .
Implemented in FLT::Zmf, FLT::Trimf, FLT::Trapmf, FLT::Sig2mf, FLT::Sigmf, FLT::Smf, FLT::PSigmf, FLT::Pimf, FLT::GBellmf, FLT::Gauss2mf, FLT::Gaussmf, FLT::Constmf, and FLT::Anymf.
size_t Membership::num_params | ( | void | ) | const |
Reads the number of parameters that define the Membership function.
We recommend using this function instead of the constant FLT::MF_PARAM_NUMBER, since it is possible to create Membership functions with a variable number of parameters.
|
pure virtual |
Evaluates the derivative of the Membership function with respect to a parameter, .
Implemented in FLT::Zmf, FLT::Trimf, FLT::Trapmf, FLT::Sig2mf, FLT::Sigmf, FLT::Smf, FLT::PSigmf, FLT::Pimf, FLT::GBellmf, FLT::Gauss2mf, FLT::Gaussmf, FLT::Constmf, and FLT::Anymf.
double Membership::read | ( | size_t | index | ) | const |
Reads a parameter of the Membership function.
index
is greater than the number of function parameters, an error is sent to the standard error stream and return 0.
|
virtual |
This function checks parameters in the Membership function, and corrects them if possible.
Reimplemented in FLT::Trimf, FLT::Trapmf, FLT::GBellmf, FLT::Gauss2mf, and FLT::Gaussmf.
TYPE_MF Membership::type | ( | void | ) | const |
Returns the type of Membership function.
The type of Membership function is represented with the enumeration FLT::TYPE_MF.
int Membership::type | ( | TYPE_MF | type_mf | ) |
Changes the Membership function type.