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

The (experimental) WeightedAverageCustom class is a WeightedDefuzzifier that computes the weighted average of a fuzzy set represented in an Aggregated Term utilizing the fuzzy operators for implication and aggregation to compute the weighted average. More...

#include <WeightedAverageCustom.h>

Inheritance diagram for fl::WeightedAverageCustom:
Collaboration diagram for fl::WeightedAverageCustom:

Public Member Functions

 WeightedAverageCustom (Type type=Automatic)
 
 WeightedAverageCustom (const std::string &type)
 
virtual ~WeightedAverageCustom () FL_IOVERRIDE
 
virtual std::string className () const FL_IOVERRIDE
 Returns the name of the class of the defuzzifier. More...
 
virtual Complexity complexity (const Term *term) const FL_IOVERRIDE
 Computes the complexity of defuzzifying the given term. More...
 
virtual scalar defuzzify (const Term *term, scalar minimum, scalar maximum) const FL_IOVERRIDE
 Computes the weighted average of the given fuzzy set represented as an AggregatedTerm as \(y = \dfrac{\sum_i w_iz_i}{\sum_i w_i} \), where \(w_i\) is the activation degree of term \(i\), and \(z_i = \mu_i(w_i) \). More...
 
virtual WeightedAverageCustomclone () const FL_IOVERRIDE
 Creates a clone of the defuzzifier. More...
 
- Public Member Functions inherited from fl::WeightedDefuzzifier
 WeightedDefuzzifier (Type type=Automatic)
 
 WeightedDefuzzifier (const std::string &type)
 
virtual ~WeightedDefuzzifier () FL_IOVERRIDE
 
void setType (Type type)
 Sets the type of the weighted defuzzifier. More...
 
Type getType () const
 Gets the type of the weighted defuzzifier. More...
 
virtual std::string getTypeName () const
 Returns a string representation of the type of the defuzzifier. More...
 
virtual Type inferType (const Term *term) const
 Infers the type of the defuzzifier based on the given term. More...
 
- Public Member Functions inherited from fl::Defuzzifier
 Defuzzifier ()
 
virtual ~Defuzzifier ()
 

Static Public Member Functions

static Defuzzifierconstructor ()
 
- Static Public Member Functions inherited from fl::WeightedDefuzzifier
static std::string typeName (Type type)
 Returns a string representation of the given type. More...
 

Additional Inherited Members

- Public Types inherited from fl::WeightedDefuzzifier
enum  Type { Automatic, TakagiSugeno, Tsukamoto }
 The Type enum indicates the type of the WeightedDefuzzifier based the terms included in the fuzzy set. More...
 

Detailed Description

The (experimental) WeightedAverageCustom class is a WeightedDefuzzifier that computes the weighted average of a fuzzy set represented in an Aggregated Term utilizing the fuzzy operators for implication and aggregation to compute the weighted average.

This is an experimental approach to take advantage of customization thanks to the object-oriented design.

Author
Juan Rada-Vilela, Ph.D.
See also
WeightedAverage
WeightedSum
WeightedSumCustom
WeightedDefuzzifier
Defuzzifier
Since
6.0

Definition at line 40 of file WeightedAverageCustom.h.

Constructor & Destructor Documentation

◆ WeightedAverageCustom() [1/2]

fl::WeightedAverageCustom::WeightedAverageCustom ( Type  type = Automatic)
explicit

◆ WeightedAverageCustom() [2/2]

fl::WeightedAverageCustom::WeightedAverageCustom ( const std::string &  type)
explicit

◆ ~WeightedAverageCustom()

virtual fl::WeightedAverageCustom::~WeightedAverageCustom ( )
virtual

Member Function Documentation

◆ className()

virtual std::string fl::WeightedAverageCustom::className ( ) const
virtual

Returns the name of the class of the defuzzifier.

Returns
the name of the class of the defuzzifier

Implements fl::Defuzzifier.

◆ clone()

virtual WeightedAverageCustom* fl::WeightedAverageCustom::clone ( ) const
virtual

Creates a clone of the defuzzifier.

Returns
a clone of the defuzzifier

Implements fl::Defuzzifier.

◆ complexity()

virtual Complexity fl::WeightedAverageCustom::complexity ( const Term term) const
virtual

Computes the complexity of defuzzifying the given term.

Parameters
termis the term to defuzzify
Returns
the complexity of defuzzifying the given term

Implements fl::Defuzzifier.

◆ constructor()

static Defuzzifier* fl::WeightedAverageCustom::constructor ( )
static

◆ defuzzify()

virtual scalar fl::WeightedAverageCustom::defuzzify ( const Term term,
scalar  minimum,
scalar  maximum 
) const
virtual

Computes the weighted average of the given fuzzy set represented as an AggregatedTerm as \(y = \dfrac{\sum_i w_iz_i}{\sum_i w_i} \), where \(w_i\) is the activation degree of term \(i\), and \(z_i = \mu_i(w_i) \).

If the implication and aggregation operators are set to fl::null (or set to AlgebraicProduct and UnboundedSum, respectively), then the operation of WeightedAverageCustom is the same as the WeightedAverage. Otherwise, the implication and aggregation operators are utilized to compute the multiplications and sums in \(y\), respectively.

Parameters
termis the fuzzy set represented as an Aggregated Term
minimumis the minimum value of the range (only used for Tsukamoto)
maximumis the maximum value of the range (only used for Tsukamoto)
Returns
the weighted average of the given fuzzy set

Implements fl::Defuzzifier.


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