jFuzzyLogic/fcl/QoS/LarsenQoSFewRules.fcl

53 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

2014-12-19 14:30:46 +01:00
FUNCTION_BLOCK LarsenQoSFewRules
VAR_INPUT
commitment : REAL;
clarity : REAL;
influence : REAL;
END_VAR
VAR_OUTPUT
service_quality : REAL;
END_VAR
FUZZIFY commitment
TERM nothing := GAUSS 0 1;
TERM minimal := GAUSS 1 1;
TERM partially := GAUSS 2 1;
TERM satISfactory := GAUSS 3 1;
TERM largely := GAUSS 4 1;
TERM fully := GAUSS 5 1;
END_FUZZIFY
FUZZIFY clarity
TERM low := GAUSS 0 1;
TERM medium := GAUSS 2.5 1;
TERM high:= GAUSS 5 1;
END_FUZZIFY
FUZZIFY influence
TERM low := GAUSS 0 1;
TERM medium := GAUSS 2.5 1;
TERM high:= GAUSS 5 1;
END_FUZZIFY
DEFUZZIFY service_quality
TERM inadequate := GAUSS 0 1;
TERM sufficient := GAUSS 2.5 1;
TERM excellent := GAUSS 5 1;
METHOD : COG;
DEFAULT := 0;
END_DEFUZZIFY
RULEBLOCK No1
AND : PROD;
ACCU : MAX;
RULE 1 : IF commitment IS fully AND influence IS high THEN service_quality IS excellent;
RULE 2 : IF commitment IS partially AND clarity IS high AND influence IS low THEN service_quality IS sufficient;
RULE 3 : IF commitment IS nothing THEN service_quality IS inadequate;
END_RULEBLOCK
END_FUNCTION_BLOCK