mirror of
https://github.com/marcin-szczepanski/jFuzzyLogic.git
synced 2024-12-18 16:35:27 +01:00
26 lines
337 B
Plaintext
26 lines
337 B
Plaintext
|
|
||
|
FUNCTION_BLOCK MembershipWithVariables
|
||
|
|
||
|
VAR_INPUT
|
||
|
mid : REAL;
|
||
|
high : REAL;
|
||
|
low : REAL;
|
||
|
END_VAR
|
||
|
|
||
|
VAR_OUTPUT
|
||
|
out : REAL;
|
||
|
END_VAR
|
||
|
|
||
|
DEFUZZIFY out
|
||
|
METHOD : COG;
|
||
|
DEFAULT := 4;
|
||
|
|
||
|
TERM low := (0, 0) (low, 1) (mid, 0) ;
|
||
|
TERM middle := (low, 0) (mid, 1) (high, 0);
|
||
|
TERM high := (mid, 0) (high, 1) ;
|
||
|
|
||
|
END_DEFUZZIFY
|
||
|
|
||
|
END_FUNCTION_BLOCK
|
||
|
|