Octave Fuzzy Logic Toolkit: showrule

### Function Reference: `showrule`

Function File: showrule (fis)
Function File: showrule (fis, index_list)
Function File: showrule (fis, index_list, format)
Function File: showrule (fis, index_list, 'verbose', language)
Function File: showrule (fis, index_list, 'verbose', 'custom', {"and" "or" "If" "then" "is" "isn't" "somewhat" "very" "extremely" "very very"})

Show the rules for an FIS structure in verbose, symbolic, or indexed format. Built in languages for the ’verbose’ format are: English, Chinese (or Mandarin, Pinyin), Russian (or Pycckii, Russkij), French (or Francais), Spanish (or Espanol), and German (or Deutsch). The names of the languages are case-insensitive, Chinese is written in Pinyin, and Russian is transliterated.

To use a custom language, enter ’verbose’ and ’custom’ for the third and fourth parameters, respectively, and a cell array of ten strings (to specify the custom language) corresponding to the English {"and" "or" "If" "then" "is" "isn’t" "somewhat" "very" "extremely" "very very"} for the fifth parameter.

To run the demonstration code, type "`demo showrule`" (without the quotation marks) at the Octave prompt.

See also: addrule, getfis, showfis

### Example: 1

     fis = readfis ('sugeno_tip_calculator.fis');
     puts ("Output of: showrule(fis)\n");
     showrule (fis)
     puts ("\n");

    Output of: showrule(fis)
    1. If (Food-Quality is extremely Bad) and (Service is extremely Bad), then (Cheap-Tip is extremely Low) and (Average-Tip is very Low) and (Generous-Tip is Low) (1)
    2. If (Food-Quality is Good) and (Service is extremely Bad), then (Cheap-Tip is Low) and (Average-Tip is Low) and (Generous-Tip is Medium) (1)
    3. If (Food-Quality is very Good) and (Service is very Bad), then (Cheap-Tip is Low) and (Average-Tip is Medium) and (Generous-Tip is High) (1)
    4. If (Food-Quality is Bad) and (Service is Bad), then (Cheap-Tip is Low) and (Average-Tip is Low) and (Generous-Tip is Medium) (1)
    5. If (Food-Quality is Good) and (Service is Bad), then (Cheap-Tip is Low) and (Average-Tip is Medium) and (Generous-Tip is High) (1)
    6. If (Food-Quality is extremely Good) and (Service is Bad), then (Cheap-Tip is Low) and (Average-Tip is Medium) and (Generous-Tip is very High) (1)
    7. If (Food-Quality is Bad) and (Service is Good), then (Cheap-Tip is Low) and (Average-Tip is Medium) and (Generous-Tip is High) (1)
    8. If (Food-Quality is Good) and (Service is Good), then (Cheap-Tip is Medium) and (Average-Tip is Medium) and (Generous-Tip is very High) (1)
    9. If (Food-Quality is very Bad) and (Service is very Good), then (Cheap-Tip is Low) and (Average-Tip is Medium) and (Generous-Tip is High) (1)
    10. If (Food-Quality is very very Good) and (Service is very very Good), then (Cheap-Tip is High) and (Average-Tip is very High) and (Generous-Tip is extremely High) (1)

### Example: 2

     fis = readfis ('sugeno_tip_calculator.fis');
     puts ("Output of: showrule(fis, [2 4], 'symbolic')\n");
     showrule (fis, [2 4], 'symbolic')
     puts ("\n");

    Output of: showrule(fis, [2 4], 'symbolic')
    2.  (Food-Quality == Good) && (Service == Bad^3.0) => (Cheap-Tip == Low) && (Average-Tip == Low) && (Generous-Tip == Medium) (1)
    4.  (Food-Quality == Bad) && (Service == Bad) => (Cheap-Tip == Low) && (Average-Tip == Low) && (Generous-Tip == Medium) (1)

### Example: 3

     fis = readfis ('sugeno_tip_calculator.fis');
     puts ("Output of: showrule(fis, 1:4, 'indexed')\n");
     showrule (fis, 1:4, 'indexed')
     puts ("\n");

    Output of: showrule(fis, 1:4, 'indexed')
    1.30 1.30, 1.30 1.20 1 (1) : 1
    2 1.30, 1 1 2 (1) : 1
    2.20 1.20, 1 2 3 (1) : 1
    1 1, 1 1 2 (1) : 1

### Example: 4

     fis = readfis ('sugeno_tip_calculator.fis');
     puts ("Output of: showrule(fis, 1, 'verbose', 'francais')\n");
     showrule (fis, 1, 'verbose', 'francais')
     puts ("\n");

    Output of: showrule(fis, 1, 'verbose', 'francais')
    1. Si (Food-Quality est extremement Bad) et (Service est extremement Bad), alors (Cheap-Tip est extremement Low) et (Average-Tip est tres Low) et (Generous-Tip est Low) (1)