AI::FuzzyLogic 0.05 review

Download
by rbytes.net on

AI::FuzzyLogic is a Perl module for Fuzzy Set Operations and Tools. SYNOPSIS use AI::FuzzyLogic; $i = new AI::FuzzyLogic

License: Perl Artistic License
File size: 23K
Developer: Scott Walters
0 stars award from rbytes.net

AI::FuzzyLogic is a Perl module for Fuzzy Set Operations and Tools.

SYNOPSIS

use AI::FuzzyLogic;

$i = new AI::FuzzyLogic $unittype, @numbers; # new set with one subset
$i = new AI::FuzzyLogic 'age', 0, 0.1, 0.2, 0.1, 0; # same thing

$i = new AI::FuzzyLogic $subset1, $subset2, $subset3; # new set with several subsets

# another syntax for building a set with several subsets:
$i = AI::FuzzyLogic->new(
AI::FuzzyLogic->new('distance', 0.0, 0.1, 0.1, 0.5, 0.8, 0.6, 0.3, 0.0),
AI::FuzzyLogic->new('time', 0.3, 0.3, 0.1, 0.1, 0.1, 0.2, 0.3, 0.3),
AI::FuzzyLogic->new('heat', 0.0, 0.1, 0.1, 0.2, 0.2, 0.3, 0.3, 0.2),
);

# constructors for explicit combinational behavior:
$i = new AI::FuzzyLogic::Correlator 'speed', 0.1, 0.3, 0.2, 0.1, 0.1;
$i = new AI::FuzzyLogic::Permutator 'speed', 0.1, 0.3, 0.2, 0.1, 0.1;
$i = new AI::FuzzyLogic::Discriminator 'speed', 0.1, 0.3, 0.2, 0.1, 0.1;
$i = new AI::FuzzyLogic::Abstractor 'speed', 0.1, 0.3, 0.2, 0.1, 0.1;

# change combinational behavior:
$set->as_correlator(); # operations work on matching subsets of same type
$set->as_permutator(); # operations work across all subsets of each set
$set->as_discriminator(); # operations best matching subset from right for each on left
$set->as_abstractor(); # operations return one set with one subset summerizing fit

$i->add_subsets($j); # combine subsets or other sets in

abs($i) # defuzzify to integer (centroid - curve middle, x axis)
0+$i # defuzzify to integer (mean - average curve height, y axis)

$a & $b # intersection of sets
$a | $b # union of sets
$i++ # normalize curve to 1.0
$i-- # stretch curve to edges
~$i # negate set
$i ** 0.5 # dialation
"$i" # convert subsets to ASCII graphs

$a + $b # sum sets
$a - $b # subtract sets
$a * $b # multiply sets - useful for sensitivity control
$a / $b # divide sets - useful for sensitivity control

$h->larger($a) # boolean: does $h completely encompass $a?

$a ^ $b # xor: same as ~($a | $b)
$a < $b # compare volume: is $a smaller?
$a > $b # compare volume: is $a larger?

@sets = $a->unwrap(); # get subsets as list of AI::FuzzyLogic::Subset objects
@sets = $a->query_type('type'); # get subsets of type 'type' as a list of AI::FuzzyLogic::Subset objects
$a->change_type('fromtype', 'to'); # change type of subsets of type 'fromtype' to 'to'

Performs all basic operations on Fuzzy Sets. Use English-like, intentionally vague objects representing concepts with which to make inferences. The inferences might be approximate reasoning about precise knowledge, or precise reasoning about approximate knowledge. This vagueness allows the capture and application of human expert knowledge.

Overloads Perl operators to perform operations on Fuzzy Sets.

Requirements:
Perl

AI::FuzzyLogic 0.05 search tags