EXPORT

Nothing is exported or exportable.

DESCRIPTION

This module is yet another implementation of a fuzzy inference system. The aim was to be able to code rules (no string parsing), but avoid operator overloading, and make it possible to split calculation into multiple steps. All intermediate results (memberships of sets of variables) should be available.

Beginning with v0.2.0 it is PDL aware, meaning that it can handle piddles (PDL objects) when running the fuzzy operations. More information on PDL can be found at http://pdl.perl.org/.

Credits to Ala Qumsieh and his AI::FuzzyInference, that showed me that fuzzy is no magic. I learned a lot by analyzing his code, and he provides good information and links to learn more about Fuzzy Logics.

Fuzzy stuff

The AI::FuzzyEngine object defines and provides the elementary operations for fuzzy sets. All membership degrees of sets are values from 0 to 1. Up to now there is no choice with regard to how to operate on sets:

$fe->or( ... ) (Disjunction)

is Maximum of membership degrees

$fe->and( ... ) (Conjunction)

is Minimum of membership degrees

$fe->not( $var->$set ) (Negation)

is 1-degree of membership degree

Aggregation of rules (Disjunction)

is Maximum

True $fe->true() and false $fe->false()

are provided for convenience.

Defuzzification is based on

Implication

Clip membership function of a set according to membership degree, before the implicated memberships of all sets of a variable are taken for defuzzification:

Defuzzification

Centroid of aggregated (and clipped) membership functions

Public functions

Creation of an AI::FuzzyEngine object by

my $fe = AI::FuzzyEngine->new();

This function has no parameters. It provides the fuzzy methods or, and and not, as listed above. If needed, I will introduce alternative fuzzy operations, they will be configured as arguments to new.

Result is an AI::FuzzyEngine::Variable. The name_of_set strings are taken to assign corresponding methods for the respective fuzzy variables. They must be valid function identifiers. Same name_of_set can used for different variables without conflict. Take care: There is no check for conflicts with predefined class methods.

Fuzzy variables provide a method to fuzzify input values:

$var->fuzzify( $val );

according to the defined sets and their membership functions.

The memberships of the sets of $var are accessible by the respective functions:

my $membership_degree = $var->$name_of_set();

Membership degrees can be assigned directly (within rules for example):

The variable will be reset when replacing a membership function of any of its sets. Interdependencies with other variables are not checked (it might happen that the results of any rules are no longer valid, so it needs some recalculations).

Sometimes internal variables are used that need neither fuzzification nor defuzzification. They can be created by a simplified call to new_variable: