Fuzzy Logic Tools  v1.0.5.1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
Public Member Functions | Private Attributes | List of all members
FLT::System Class Reference

This class contains methods and attributes common to fuzzy Systems. More...

#include <system.hpp>

Collaboration diagram for FLT::System:
Collaboration graph
[legend]

Public Member Functions

size_t inputs (void) const
 Returns the number of inputs of the System.
 
size_t outputs (void) const
 Returns the number of outputs of the System.
 
size_t rules (size_t output) const
 Returns the number of rules for the output output of the System.
 
TNT::Array1D< size_t > rules (void) const
 Returns the number of rules for each output of the System.
 
TNT::Array1D< double > in_low (void) const
 Returns the low limits of the System inputs.
 
double in_low (size_t input) const
 Returns the low limit of the input input.
 
TNT::Array1D< double > in_high (void) const
 Returns the high limits of the System inputs.
 
double in_high (size_t input) const
 Returns the high limit of the input input.
 
TNT::Array1D< double > out_low (void) const
 Returns the low limits of the System outputs.
 
double out_low (size_t output) const
 Returns the low limit of the output output.
 
TNT::Array1D< double > out_high (void) const
 Returns the high limits of the System outputs.
 
double out_high (size_t output) const
 Returns the high limit of the output output.
 
void in_low (double *limits)
 Changes the low limits of the System inputs.
 
void in_high (double *limits)
 Changes the high limits of the System inputs.
 
void out_low (double *limits)
 Changes the low limits of the System outputs.
 
void out_high (double *limits)
 Changes the high limits of the System outputs.
 
int checkInputLimits (const double *const point)
 Checks if point meets the input limits of the system. More...
 
int checkOutputLimits (const double *const output)
 Checks if output meets the output limits of the system. More...
 
int test (void) const
 This function checks the parameters of all Membership functions of the System, and corrects them if possible. More...
 
int changeRule (const Rule &R, size_t r, size_t output)
 Changes a Rule in the System. More...
 
int readRule (Rule &R, size_t output, size_t r) const
 Reads a Rule from the System. More...
 
RulereadRule (size_t output, size_t r)
 Extracts a pointer to a Rule from the System. More...
 
void initialize (size_t in, size_t out, size_t *N)
 Initializes the System with in inputs, out outputs and N[out] rules for each output.
 
size_t NumberOfAntecedents (void)
 Gets the number of parameters stored in the antecedents of the System.
 
int setAntecedents (const double *const parameters)
 Sets all the parameters of the antecedents of the System. More...
 
TNT::Array1D< double > getAntecedents (void)
 Gets all the parameters of the antecedents of the System. More...
 
size_t NumberOfConsequents (void)
 Gets the number of parameters stored in the consequents of the System.
 
void setConsequents (const double *const parameters)
 Sets all the consequets of the System. More...
 
TNT::Array1D< double > getConsequents (void)
 Gets the consequets of the System. More...
 
TNT::Array1D< double > evaluate (const double *const point)
 Evaluates the System for input point. More...
 
Systemoperator= (const System &S)
 
 System (const System &S)
 
 System (size_t in, size_t out, size_t *N)
 

Private Attributes

size_t in
 Number of inputs of the System.
 
size_t out
 Number of outputs of the System.
 
size_t * N
 Number of rules of the System for each output.
 
double * low_in
 Low limits for the inputs of the System.
 
double * low_out
 Low limits for the outputs of the System.
 
double * high_in
 High limits for the inputs of the System.
 
double * high_out
 High limits for outputs of the System.
 
Rule ** R
 System Rules.
 

Detailed Description

This class contains methods and attributes common to fuzzy Systems.

This class stores a completely general Takagi-Sugeno fuzzy System.

See also
For Template Numerical Toolkit (TNT) documentation see http://math.nist.gov/tnt
Examples:
example.cpp, matlab_utilities/activation.cpp, matlab_utilities/antec2mat.cpp, matlab_utilities/aproxjac.cpp, matlab_utilities/aproxlinear.cpp, matlab_utilities/conseq2mat.cpp, matlab_utilities/extractPoints.cpp, matlab_utilities/fis2txt.cpp, matlab_utilities/fuz2mat.cpp, matlab_utilities/fuzcomb.cpp, matlab_utilities/fuzderaffine.cpp, matlab_utilities/fuzderantec.cpp, matlab_utilities/fuzderconseq.cpp, matlab_utilities/fuzderparam.cpp, matlab_utilities/fuzeval.cpp, matlab_utilities/fuzjac.cpp, matlab_utilities/fuzlinear.cpp, matlab_utilities/fuzprint.cpp, matlab_utilities/fuzsubsystem.cpp, matlab_utilities/initializeController.cpp, matlab_utilities/Kalmanantec.cpp, matlab_utilities/Kalmanconseq.cpp, matlab_utilities/Kalmanfuz.cpp, matlab_utilities/mat2antec.cpp, matlab_utilities/mat2conseq.cpp, matlab_utilities/mat2fuz.cpp, and matlab_utilities/txt2fis.cpp.

Member Function Documentation

int System::changeRule ( const Rule R,
size_t  r,
size_t  output 
)

Changes a Rule in the System.

Returns
Returns 0 if no errors.
An error means that the rule or the output indicated are beyond the limits of the system.
int System::checkInputLimits ( const double *const  point)

Checks if point meets the input limits of the system.

Returns
Returns 0 if low_in[i] <= point[i] <= high_in[i], for i = 1..in.
If point[i] < low_in[i] or point[i] > high_in[i], returns 1 + the lowest value of i that breaks limits.
int System::checkOutputLimits ( const double *const  output)

Checks if output meets the output limits of the system.

Returns
Returns 0 if low_out[j] <= output[j] <= high_out[j], for i = j..out.
If output[j] < low_out[j] or output[j] > high_out[j], returns 1 + the lowest value of j that breaks limits.
Array1D< double > System::evaluate ( const double *const  point)

Evaluates the System for input point.

If point or output are beyond the limits of the system, a warning message is sent to the standard error stream.

Examples:
matlab_utilities/fuzeval.cpp.
Array1D< double > System::getAntecedents ( void  )

Gets all the parameters of the antecedents of the System.

The antecedents must be sorted for each output, for each rule.

Examples:
matlab_utilities/antec2mat.cpp, and matlab_utilities/fuz2mat.cpp.
Array1D< double > System::getConsequents ( void  )

Gets the consequets of the System.

The consequets are sorted for each output, for each rule, the affine term and the consequents of each input.

Examples:
matlab_utilities/conseq2mat.cpp, and matlab_utilities/fuz2mat.cpp.
int System::readRule ( Rule R,
size_t  output,
size_t  r 
) const
Rule * System::readRule ( size_t  output,
size_t  r 
)

Extracts a pointer to a Rule from the System.

Returns
Returns NULL if the rule or the output indicated are beyond the limits of the system.
int System::setAntecedents ( const double *const  parameters)

Sets all the parameters of the antecedents of the System.

The antecedents must be sorted for each output, for each rule.

Returns
Returns the result of running the System::test() method.
Examples:
matlab_utilities/mat2antec.cpp, and matlab_utilities/mat2fuz.cpp.
void System::setConsequents ( const double *const  parameters)

Sets all the consequets of the System.

The consequets must be sorted for each output, for each rule, the affine term and the consequents of each input.

Examples:
matlab_utilities/mat2conseq.cpp, and matlab_utilities/mat2fuz.cpp.
int System::test ( void  ) const

This function checks the parameters of all Membership functions of the System, and corrects them if possible.

Returns
Returns 0 if no errors, 1 if an error occurs, and -1 if the parameters were corrected.

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