Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
There's more than one way to do things
 
PerlMonks  

RFC: A Beginners Guide to Fuzzy Rules-Based Systems

by lin0 (Curate)
on Oct 12, 2006 at 05:51 UTC ( #577755=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. 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
    
  2. or download this
    use AI::FuzzyInference;
    
  3. or download this
    my $fis = AI::FuzzyInference->new;
    
  4. 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 ],
               );
    
  5. or download this
        |
    1.00|BBBB   
    ...
        |      B     
        |________B________________
        0   2    4    6    8    10
    
  6. 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 ],
              );
    
  7. or download this
        |
    1.00|MMMM   
    ...
        |      M     
        |_______M_____________________
        0  20  40  60  80 100
    
  8. 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',
    
  9. or download this
    $fis->compute( quality => $quality_of_service,
                   speed   => $speed_of_service);
    
  10. or download this
    my $award = $fis->value('award');
    
  11. 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
    
  12. or download this
    $fis->operation( '&', 'difference');
    $fis->operation( '|', 'sum');
    $fis->implication( 'scale' );
    
  13. or download this
    #!/usr/bin/perl
    use warnings;
    ...
    print "new values of | and implication\n";
    print "| = ", $fis->operation( '|' ),"\n";
    print "implication = ", $fis->implication(), "\n";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://577755]
Approved by GrandFather
Front-paged by wfsp
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2014-04-16 11:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (424 votes), past polls