home Forums # Technical Support What FCL version does Fuzzylite use? Reply To: What FCL version does Fuzzylite use?

#1019
Unknown
Member

Hi Juan

Thank you for your reply. For using Fuzzylite in .Net, I finally managed to convert your Java version to a DLL using IKVMC utility.. I think this can be advised to other .Net developers. It seems working and it was much easier than transforming c++ version. My next question is, if you are consideingr using lookuptable or memoization or similar techniques to increase performance in intensive computation and if any considerations are ther for a parallel processing environment. Here is a sample of jFuzzyLogic FCL files.

Best Regards

// Block definition (there may be more than one block per file)
FUNCTION_BLOCK tipper

// Define input variables
VAR_INPUT
service : REAL;
food : REAL;
END_VAR

// Define output variable
VAR_OUTPUT
tip : REAL;
END_VAR

// Fuzzify input variable ‘service’
FUZZIFY service
TERM poor := (0, 1) (4, 0) ;
TERM good := (1, 0) (4,1) (6,1) (9,0);
TERM excellent := (6, 0) (9, 1);
END_FUZZIFY

// Fuzzify input variable ‘food’
FUZZIFY food
TERM rancid := (0, 1) (1, 1) (3,0) ;
TERM delicious := (7,0) (9,1);
END_FUZZIFY

// Defzzzify output variable ‘tip’
DEFUZZIFY tip
TERM cheap := (0,0) (5,1) (10,0);
TERM average := (10,0) (15,1) (20,0);
TERM generous := (20,0) (25,1) (30,0);
// Use ‘Center Of Gravity’ defuzzification method
METHOD : COG;
// Default value is 0 (if no rule activates defuzzifier)
DEFAULT := 0;
END_DEFUZZIFY

RULEBLOCK No1
// Use ‘min’ for ‘and’ (also implicit use ‘max’
// for ‘or’ to fulfill DeMorgan’s Law)
AND : MIN;
// Use ‘min’ activation method
ACT : MIN;
// Use ‘max’ accumulation method
ACCU : MAX;

RULE 1 : IF service IS poor OR food IS rancid
THEN tip IS cheap;

RULE 2 : IF service IS good
THEN tip IS average;

RULE 3 : IF service IS excellent AND food IS delicious
THEN tip is generous;
END_RULEBLOCK

END_FUNCTION_BLOCK

  • This reply was modified 9 years, 6 months ago by Unknown.