A fuzzy logic C++ library
Miscellaneous information

On this page, miscellaneous information that for the moment doesn't fit elsewhere...


  1. About the concept of "firing strength"
  2. Enumeration to string functions
  3. Gaussian function approximation

About the concept of "firing strength"

This term can have two different meanings, we can have the firing strength of an input related to a membership function, or we can have the firing strength of a rule, given a set of input values. This latter meaning is used for Takagi-Sugeno inference.

Firing strength of an input value

This is about how much a given input value "triggers" a membership value. For example, if we have an input with an associated set of two triangular membership function such as the following:


If the input value is, for example 27.5, then the membership function mf1 will be triggered with a (fuzzy) value of 0.2, and the membership function mf2 will be triggered with a value of 0.8.

This can be used when plotting a 2-input rule base (class slifis_plot::PLOT_RB_2D), to visually show how much the input triggers the input functions.

Related functions:

Firing strength of a rule

This is about the firing strength of a rule, expressed as a fuzzy value, for some input values. It can be defined by the degree to which the antecedent part of a fuzzy rule is satisfied. It is also known as "degree of fulfillment" in some sources. Its computation depend on the rule operator:

It works as follow, for a rule r:

For example, for a given "AND" rule, and using the (default) product t-norm

if input-1 is "blue" and input-2 is "hot" and input-3 is "nice", then output is ...

If input-1 triggers the "blue" membership function with a value of 0.9, input-2 triggers the "hot" membership function with a value of 0.8, and input-3 triggers the "nice" membership function with a value of 0.4, then the Firing strength of the rule will be $ 0.9 \times 0.8 \times 0.4 = 0.288$

Related functions:

Enumeration to string functions

In order to print human readable strings from enumerations values, all the enum types have an associated GetString() function.

Usage: say you have an enum value enum_val of type EN_ENUMTYPE, and you want to print out its value in a human-readable form:

        EN_ENUMTYPE enum_val;
        enum_val = ...; // some value
        cout << "enum_val = " << GetString(enum_val) << endl;

Additionally, the following function are also related, although they have no argument:

Gaussian function approximation

The library provides an approximation of a Gaussian function using 6 line segments (3 per side). Each segment approximates a part of the Gaussian function $ f_G(x) $. For a centered ( $\mu_0=0 $) function, the segments are computed as follows:

The values $ k_1, k_2, k_3 $ are at present arbitrary chosen to produce something that looks ok. The corresponding error can be plotted with the gnuplot script file misc/GaussianError.plt, that produces the following plots. Absolute error will be less than 3% most of the time.

Real Gaussian compared to approximation Absolute error (adapted scale)

See also: