diff options
author | Johannes Schauer <josch@debian.org> | 2015-07-07 11:12:00 +0200 |
---|---|---|
committer | Johannes Schauer <josch@debian.org> | 2015-07-07 11:12:00 +0200 |
commit | d210b3addc8ffed7214afd8c7882e700fbcc38c5 (patch) | |
tree | ded15607f7f24f83d2d0d7c542265c0a97af577a /examples/mamdani/octave/mamdani_tip_calculator.fcl |
fuzzylite (5.1+dfsg-1) unstable; urgency=medium
* new upstream version (Closes: #777858)
* removed debian/patches/20140705-minor-improvements-on-building-script as
upstream integrated it. Adjust build options in d/rules accordingly.
* delete debian/patches/20140714-building-from-objects-just-once and
debian/patches/20141027-fix-some-spelling as they have been applied
upstream
* install usr/lib/*/pkgconfig/fuzzylite.pc in fuzzylite-dev
* SONAME bump from 5.0 to 5.1, so renaming libfuzzylite5.0 to
libfuzzylite5.1
* add debian/patches/pkgconfig_installdir to install pkgconfig file in
correct location
# imported from the archive
Diffstat (limited to 'examples/mamdani/octave/mamdani_tip_calculator.fcl')
-rw-r--r-- | examples/mamdani/octave/mamdani_tip_calculator.fcl | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/examples/mamdani/octave/mamdani_tip_calculator.fcl b/examples/mamdani/octave/mamdani_tip_calculator.fcl new file mode 100644 index 0000000..3ea903a --- /dev/null +++ b/examples/mamdani/octave/mamdani_tip_calculator.fcl @@ -0,0 +1,55 @@ +FUNCTION_BLOCK Mamdani-Tip-Calculator + +VAR_INPUT + FoodQuality: REAL; + Service: REAL; +END_VAR + +VAR_OUTPUT + Tip: REAL; + CheckPlusTip: REAL; +END_VAR + +FUZZIFY FoodQuality + RANGE := (1.000 .. 10.000); + TERM Bad := Trapezoid 0.000 1.000 3.000 7.000; + TERM Good := Trapezoid 3.000 7.000 10.000 11.000; +END_FUZZIFY + +FUZZIFY Service + RANGE := (1.000 .. 10.000); + TERM Bad := Trapezoid 0.000 1.000 3.000 7.000; + TERM Good := Trapezoid 3.000 7.000 10.000 11.000; +END_FUZZIFY + +DEFUZZIFY Tip + RANGE := (0.000 .. 30.000); + TERM AboutTenPercent := Gaussian 10.000 2.000; + TERM AboutFifteenPercent := Gaussian 15.000 2.000; + TERM AboutTwentyPercent := Gaussian 20.000 2.000; + METHOD : COG; + ACCU : ASUM; + DEFAULT := nan; +END_DEFUZZIFY + +DEFUZZIFY CheckPlusTip + RANGE := (1.000 .. 1.300); + TERM PlusAboutTenPercent := Gaussian 1.100 0.020; + TERM PlusAboutFifteenPercent := Gaussian 1.150 0.020; + TERM PlusAboutTwentyPercent := Gaussian 1.200 0.020; + METHOD : COG; + ACCU : ASUM; + DEFAULT := nan; +END_DEFUZZIFY + +RULEBLOCK + AND : PROD; + OR : MAX; + ACT : MIN; + RULE 1 : if FoodQuality is Bad and Service is Bad then Tip is AboutTenPercent and CheckPlusTip is PlusAboutTenPercent + RULE 2 : if FoodQuality is Bad and Service is Good then Tip is AboutFifteenPercent and CheckPlusTip is PlusAboutFifteenPercent + RULE 3 : if FoodQuality is Good and Service is Bad then Tip is AboutFifteenPercent and CheckPlusTip is PlusAboutFifteenPercent + RULE 4 : if FoodQuality is Good and Service is Good then Tip is AboutTwentyPercent and CheckPlusTip is PlusAboutTwentyPercent +END_RULEBLOCK + +END_FUNCTION_BLOCK |