-4

I want to write a small code in c# using Fuzzy Logic framework where user will give input number between 0 to 10 and that numbers needs to be classified as Low, Moderate and High. Low is 0 to 3, Moderate is 3 to 7 and High is between 6 to 10. Using triangular membership function. Any guess how to do it I read some tutorials on Fuzzy Framework but couldn't get my problem fit in those. Following is code I wrote,

 class Program
    {
        static void Main(string[] args)
        { 
            ContinuousDimension score = new ContinuousDimension("score", "score of word", "unit", 0, 10);    

            //Definition of basic fuzzy sets with which we will work
            //  input sets:

 ContinuousSet low = new RightQuadraticSet(score, "Low Score", 0, 3, 4);
            ContinuousSet high = new LeftQuadraticSet(score, "High Score", 6, 7, 10);
            ContinuousSet mod = new BellSet(score, "Moderate Score", 5, 1, 2);

....
}

How should I proceed further now. I have assigned manually some score to opinion words on scale of 0 to 10 and I want to classify intensity of this opinion words as low, moderate or high using triangular function.

praxprog
  • 21
  • 5
  • 1
    Post code you've written so far, and formulate a question based on the exact problem you are working on. If you've already written a working version, and don't have specific errors and exceptions, post it to code review. – MatthewMartin May 28 '14 at 14:04
  • I edited question , please start it again ... – praxprog May 28 '14 at 15:02

1 Answers1

0

Fuzzy logic deals with handling situations effectively. Think about temperature control where you do not want to be switching back and forth from heating to cooling as that would be very energy consuming.

In your example you would have something like this:

Very low = low limit of moderate => below 2.5 => time to turn on the heater

Very high = high limit of moderate => above 7.5 => time to turn on the AC

After you have taken action on "Very low" event (turning on the heater) then the next action is when the value goes above the low upper limit (3.5) and that is when the heater is turned off.

Very Low = 0 - 2.5
Moderate Low = 2.5 - 3.5
Moderate = 3.5-6.5
Moderate High = 6.5 - 7.5
Very High = 7.5-10
SKall
  • 5,234
  • 1
  • 16
  • 25
  • thanks for help, but I have cleared my question in detail now I don't want to take some action just need to classify based on fuzzy logic so I get proper classification for vague opinions.... – praxprog May 28 '14 at 14:54