Projekt_LSR/Projekt-LSR/bin/application/ocena_wysoka_ocena.fcl
2020-06-14 13:43:10 +02:00

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 dobry;
RULE 8 : IF sr_ocena IS srednia THEN ocena IS srednia;
RULE 9 : IF sr_ocena IS niska THEN ocena IS slaby;
END_RULEBLOCK
END_FUNCTION_BLOCK