- or download this
IF “quality” IS bad AND “speed” IS slow THEN “award” IS minimum
IF “quality” IS good AND “speed” IS slow THEN “award” IS small
IF “quality” IS ok AND “speed” IS fast THEN “award” IS good
IF “quality” IS excellent AND “speed” IS fast THEN “award” IS excellen
+t
- or download this
use AI::FuzzyInference;
- or download this
my $fis = AI::FuzzyInference->new;
- or download this
$fis->inVar('quality', 0, 10,
bad => [ 0, 1, 2, 1, 4, 0 ],
...
good => [ 4, 0, 6, 1, 8, 0 ],
excelent => [ 6, 0, 8, 1, 10, 1 ],
);
- or download this
|
1.00|BBBB
...
| B
|________B________________
0 2 4 6 8 10
- or download this
$fis->outVar('award', 0, 100,
minimum => [ 0,1, 20,1, 40,0 ],
...
good => [ 40,0, 60,1, 80,0 ],
excellent => [ 60,0, 80,1, 100,1 ],
);
- or download this
|
1.00|MMMM
...
| M
|_______M_____________________
0 20 40 60 80 100
- or download this
$fis->addRule(
'quality=bad & speed=slow' => 'award=minimum',
'quality=ok & speed=slow' => 'award=minimum',
'quality=good & speed=slow' => 'award=small',
'quality=excellent & speed=slow' => 'award=small',
- or download this
$fis->compute( quality => $quality_of_service,
speed => $speed_of_service);
- or download this
my $award = $fis->value('award');
- or download this
$fis->operation( '&' ); #for the AND operation
$fis->operation( '|' ); #for the OR operation
$fis->implication(); #for the implication function
$fis->aggregation(); #for the aggregation function
$fis->defuzzification(); #for the defuzzification
- or download this
$fis->operation( '&', 'difference');
$fis->operation( '|', 'sum');
$fis->implication( 'scale' );
- or download this
#!/usr/bin/perl
use warnings;
...
print "new values of | and implication\n";
print "| = ", $fis->operation( '|' ),"\n";
print "implication = ", $fis->implication(), "\n";