Projekt LSR
This commit is contained in:
parent
e7eb4a6663
commit
9a19ac8430
@ -1,37 +0,0 @@
|
|||||||
FUNCTION_BLOCK ocena_dlugosc
|
|
||||||
|
|
||||||
VAR_INPUT
|
|
||||||
dlugosc: REAL;
|
|
||||||
END_VAR
|
|
||||||
|
|
||||||
VAR_OUTPUT
|
|
||||||
ocena : REAL;
|
|
||||||
END_VAR
|
|
||||||
|
|
||||||
FUZZIFY dlugosc
|
|
||||||
TERM krotki := (40, 1) (80,0);
|
|
||||||
TERM sredni := (60, 0) (90, 1) (120,1) (150,0);
|
|
||||||
TERM dlugi := (130, 0) (170,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 1 : IF dlugosc is dlugi THEN ocena IS dobry;
|
|
||||||
RULE 2 : IF dlugosc is sredni THEN ocena IS srednia;
|
|
||||||
RULE 3 : IF dlugosc IS krotki THEN ocena IS slaby;
|
|
||||||
|
|
||||||
END_RULEBLOCK
|
|
||||||
|
|
||||||
END_FUNCTION_BLOCK
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
|||||||
FUNCTION_BLOCK ocena
|
|
||||||
|
|
||||||
VAR_INPUT
|
|
||||||
glosy : REAL;
|
|
||||||
END_VAR
|
|
||||||
|
|
||||||
VAR_OUTPUT
|
|
||||||
ocena : REAL;
|
|
||||||
END_VAR
|
|
||||||
|
|
||||||
FUZZIFY glosy
|
|
||||||
TERM malo := (1000,1) (2500,0);
|
|
||||||
TERM srednio := (2000, 0) (3500, 1) (4500,1) (6000,0) ;
|
|
||||||
TERM duzo := (5500, 0) (6500,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 glosy IS duzo THEN ocena IS dobry;
|
|
||||||
RULE 8 : IF glosy IS srednio THEN ocena IS srednia;
|
|
||||||
RULE 9 : IF glosy IS malo THEN ocena IS slaby;
|
|
||||||
END_RULEBLOCK
|
|
||||||
|
|
||||||
END_FUNCTION_BLOCK
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
|||||||
FUNCTION_BLOCK ocena_dlugosc
|
|
||||||
|
|
||||||
VAR_INPUT
|
|
||||||
dlugosc: REAL;
|
|
||||||
END_VAR
|
|
||||||
|
|
||||||
VAR_OUTPUT
|
|
||||||
ocena : REAL;
|
|
||||||
END_VAR
|
|
||||||
|
|
||||||
FUZZIFY dlugosc
|
|
||||||
TERM krotki := (40, 1) (80,0);
|
|
||||||
TERM sredni := (60, 0) (90, 1) (120,1) (150,0);
|
|
||||||
TERM dlugi := (130, 0) (170,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 1 : IF dlugosc is krotki THEN ocena IS dobry;
|
|
||||||
RULE 2 : IF dlugosc is sredni THEN ocena IS srednia;
|
|
||||||
RULE 3 : IF dlugosc IS dlugi THEN ocena IS slaby;
|
|
||||||
|
|
||||||
END_RULEBLOCK
|
|
||||||
|
|
||||||
END_FUNCTION_BLOCK
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
|||||||
FUNCTION_BLOCK ocena
|
|
||||||
|
|
||||||
VAR_INPUT
|
|
||||||
glosy : REAL;
|
|
||||||
END_VAR
|
|
||||||
|
|
||||||
VAR_OUTPUT
|
|
||||||
ocena : REAL;
|
|
||||||
END_VAR
|
|
||||||
|
|
||||||
FUZZIFY glosy
|
|
||||||
TERM malo := (1000,1) (2500,0);
|
|
||||||
TERM srednio := (2000, 0) (3500, 1) (4500,1) (6000,0) ;
|
|
||||||
TERM duzo := (5500, 0) (6500,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 glosy IS malo THEN ocena IS dobry;
|
|
||||||
RULE 8 : IF glosy IS srednio THEN ocena IS srednia;
|
|
||||||
RULE 9 : IF glosy IS duzo THEN ocena IS slaby;
|
|
||||||
END_RULEBLOCK
|
|
||||||
|
|
||||||
END_FUNCTION_BLOCK
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
|||||||
FUNCTION_BLOCK ocena
|
|
||||||
|
|
||||||
VAR_INPUT
|
|
||||||
rok : REAL;
|
|
||||||
END_VAR
|
|
||||||
|
|
||||||
VAR_OUTPUT
|
|
||||||
ocena : REAL;
|
|
||||||
END_VAR
|
|
||||||
|
|
||||||
FUZZIFY rok
|
|
||||||
TERM stary := (1990, 1) (1997,0);
|
|
||||||
TERM sredni := (1995, 0) (2000, 1) (2005,1) (2010,0) ;
|
|
||||||
TERM nowy := (2007,0) (2015,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 4 : IF rok IS nowy THEN ocena IS dobry;
|
|
||||||
RULE 5 : IF rok IS sredni THEN ocena IS srednia;
|
|
||||||
RULE 6 : IF rok IS stary THEN ocena IS slaby;
|
|
||||||
END_RULEBLOCK
|
|
||||||
|
|
||||||
END_FUNCTION_BLOCK
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
|||||||
FUNCTION_BLOCK ocena_dlugosc
|
|
||||||
|
|
||||||
VAR_INPUT
|
|
||||||
dlugosc: REAL;
|
|
||||||
END_VAR
|
|
||||||
|
|
||||||
VAR_OUTPUT
|
|
||||||
ocena : REAL;
|
|
||||||
END_VAR
|
|
||||||
|
|
||||||
FUZZIFY dlugosc
|
|
||||||
TERM krotki := (40, 1) (80,0);
|
|
||||||
TERM sredni := (60, 0) (90, 1) (120,1) (150,0);
|
|
||||||
TERM dlugi := (130, 0) (170,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 1 : IF dlugosc is krotki THEN ocena IS slaby;
|
|
||||||
RULE 2 : IF dlugosc is sredni THEN ocena IS dobry;
|
|
||||||
RULE 3 : IF dlugosc IS dlugi THEN ocena IS slaby;
|
|
||||||
|
|
||||||
END_RULEBLOCK
|
|
||||||
|
|
||||||
END_FUNCTION_BLOCK
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
|||||||
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 dobry;
|
|
||||||
RULE 9 : IF sr_ocena IS niska THEN ocena IS slaby;
|
|
||||||
END_RULEBLOCK
|
|
||||||
|
|
||||||
END_FUNCTION_BLOCK
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
|||||||
FUNCTION_BLOCK ocena
|
|
||||||
|
|
||||||
VAR_INPUT
|
|
||||||
glosy : REAL;
|
|
||||||
END_VAR
|
|
||||||
|
|
||||||
VAR_OUTPUT
|
|
||||||
ocena : REAL;
|
|
||||||
END_VAR
|
|
||||||
|
|
||||||
FUZZIFY glosy
|
|
||||||
TERM malo := (1000,1) (2500,0);
|
|
||||||
TERM srednio := (2000, 0) (3500, 1) (4500,1) (6000,0) ;
|
|
||||||
TERM duzo := (5500, 0) (6500,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 glosy IS malo THEN ocena IS slaby;
|
|
||||||
RULE 8 : IF glosy IS srednio THEN ocena IS dobry;
|
|
||||||
RULE 9 : IF glosy IS duzo THEN ocena IS slaby;
|
|
||||||
END_RULEBLOCK
|
|
||||||
|
|
||||||
END_FUNCTION_BLOCK
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
|||||||
FUNCTION_BLOCK ocena
|
|
||||||
|
|
||||||
VAR_INPUT
|
|
||||||
rok : REAL;
|
|
||||||
END_VAR
|
|
||||||
|
|
||||||
VAR_OUTPUT
|
|
||||||
ocena : REAL;
|
|
||||||
END_VAR
|
|
||||||
|
|
||||||
FUZZIFY rok
|
|
||||||
TERM stary := (1990, 1) (1997,0);
|
|
||||||
TERM sredni := (1995, 0) (2000, 1) (2005,1) (2010,0) ;
|
|
||||||
TERM nowy := (2007,0) (2015,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 4 : IF rok IS nowy THEN ocena IS slaby;
|
|
||||||
RULE 5 : IF rok IS sredni THEN ocena IS dobry;
|
|
||||||
RULE 6 : IF rok IS stary THEN ocena IS slaby;
|
|
||||||
END_RULEBLOCK
|
|
||||||
|
|
||||||
END_FUNCTION_BLOCK
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
|||||||
FUNCTION_BLOCK ocena
|
|
||||||
|
|
||||||
VAR_INPUT
|
|
||||||
rok : REAL;
|
|
||||||
END_VAR
|
|
||||||
|
|
||||||
VAR_OUTPUT
|
|
||||||
ocena : REAL;
|
|
||||||
END_VAR
|
|
||||||
|
|
||||||
FUZZIFY rok
|
|
||||||
TERM stary := (1990, 1) (1997,0);
|
|
||||||
TERM sredni := (1995, 0) (2000, 1) (2005,1) (2010,0) ;
|
|
||||||
TERM nowy := (2007,0) (2015,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 4 : IF rok IS nowy THEN ocena IS slaby;
|
|
||||||
RULE 5 : IF rok IS sredni THEN ocena IS srednia;
|
|
||||||
RULE 6 : IF rok IS stary THEN ocena IS dobry;
|
|
||||||
END_RULEBLOCK
|
|
||||||
|
|
||||||
END_FUNCTION_BLOCK
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user