38 lines
663 B
Plaintext
38 lines
663 B
Plaintext
|
FUNCTION_BLOCK ocena_sr
|
||
|
|
||
|
VAR_INPUT
|
||
|
sr_ocena : REAL;
|
||
|
END_VAR
|
||
|
|
||
|
VAR_OUTPUT
|
||
|
ocena : REAL;
|
||
|
END_VAR
|
||
|
|
||
|
FUZZIFY sr_ocena
|
||
|
TERM niska := (3,1) (5,0);
|
||
|
TERM srednia := (4, 0) (5, 1) (6,1) (7,0) ;
|
||
|
TERM wysoka := (6, 0) (8,1);
|
||
|
END_FUZZIFY
|
||
|
|
||
|
DEFUZZIFY ocena
|
||
|
TERM slaby := (5,1) (11,0);
|
||
|
TERM srednia := (9,0) (15,1) (21,0);
|
||
|
TERM dobry := (19,0) (25,1);
|
||
|
METHOD : COG;
|
||
|
DEFAULT := 0;
|
||
|
END_DEFUZZIFY
|
||
|
|
||
|
RULEBLOCK No1
|
||
|
AND : MIN;
|
||
|
ACT : MIN;
|
||
|
ACCU : MAX;
|
||
|
RULE 7 : IF sr_ocena IS wysoka THEN ocena IS slaby;
|
||
|
RULE 8 : IF sr_ocena IS srednia THEN ocena IS srednia;
|
||
|
RULE 9 : IF sr_ocena IS niska THEN ocena IS dobry;
|
||
|
END_RULEBLOCK
|
||
|
|
||
|
END_FUNCTION_BLOCK
|
||
|
|
||
|
|
||
|
|