Society of Robots  Robot Forum
Software => Software => Topic started by: Admin on December 01, 2006, 11:17:07 PM

the ultimate question is, what is the difference between casebased logic vs fuzzy logic? are they the same thing? is my last algebraic example really fuzzy logic?
my current understanding:
case based method
IF temperature IS hot THEN fan blows fast
IF temperature IS cold THEN fan is off
fuzzy logic method
IF temperature IS very cold THEN stop fan
IF temperature IS cold THEN turn down fan
IF temperature IS normal THEN maintain level
IF temperature IS hot THEN speed up fan
so looking at both methods, they pretty much do the same thing but fuzzy logic has intermediate fan speeds based on arbitrary settings (cold, normal, etc.) . . .
now to add to the confusion . . .
is this fuzzy logic?
fan_speed = temperature * arbitrary_constant
it does the same exact thing as the fuzzy logic example above, but now its done more elegantly. it has much shorter code, and much higher resolution. although I am not using the IF/THEN syntax, the equation still does: IF temperature IS something THEN do something. this is why i think my method still fits the definition of fuzzy logic  same method, different syntax.
the reason I bring this up is because this tutorial has caused me like 20+ emails . . .
http://www.societyofrobots.com/programming_fuzzy_logic.shtml
my tutorial goes about fuzzy logic using the method of my algebraic form shown above. have i strayed too far, or does it still fit the definition?
* sorry for being stubborn . . . normally when people send me the 'admin you messed up' type of email, they are always right and i go and make the change hoping no one else saw the mistake :P . . . but this time i think there is a confusion of symantics, or that im stretching the definition too far . . . the definition of fuzzy logic is just too fuzzy . . . eh sorry, bad pun . . .

There was an interesting thread on the Seattle Robotics Society mailing list between Nov. 22 and Nov 30, with the subject:
"Re: L298 with Microcontroller  Fuzzy Logic"
Its worth a read...
http://tech.groups.yahoo.com/group/SeattleRobotics/message/29475
I don't know if they have the messages archive public or not, but if not, you have to join the group...
 Jon

hehe yea . . . i was the one who sparked that thread . . . and i updated my tutorial a lot based on that thread, too . . .
ok so here is the impression im getting: my method isnt fuzzy logic because it doesnt explicity define clear sets, but instead its much better (for this particular use) due to my improved notation . . .
if this is true, i can 'save' my tutorial by basically stating that my algorithms arent fuzzy logic, but a 'new and improved' notation that borrows from the concepts of fuzzy logic . . .
or am i just making things up? ???

I don't know. I try and stay away from formalized notions of AI, because I think pretty much everyone is doing it wrong.
 Jon :)

I think AI and fuzzy logic leave a lot to the author to decide what is what. A similar type question is what constitutes a robot?

I'm not a software guru  but the way I understand it, the difference between your syntax and "Fuzzy Logic" is the word "is". The basic premise of Fuzzy Logic is that there are various shades of "truth". There is no "is". There are sets "more like", or "less like" a particular condition, but all truths are relative. Kind of a "Clintonesque" view of boolean logic.

Fuzzy logic is expressed in IF/THEN rules but the mechanics underneath the evaluation of each rule, and the overall rule set is very different. The evaluation of the side of the rule preceding the THEN keyword, known as the IF part or the antecedent, is done through the use of membership sets. Membership sets take many different shapes depending on the mathematics used to build them, and often overlap at the edges so a particular mathematical value is frequently the member of two sets if it resides in the area where two membership sets overlap. Once all the rule antecedents have their membership values calculated, a preselected mathematical function is used to determine a specific numeric or "crisp" value from the list of membership values, for each of the elements in the rule consequents. There are several different functions but a popular one used for defuzzification of such values is the centroid method. This method looks at the membership values created by the evaluation of the rule antecedents as a group of geometric shapes. It calculates something akin to the center of gravity across that set to produce a single numeric value for each of the elements in the consequent, which is the part of the rule that follows the THEN keyword.
That explanation is gross oversimplifed and leaves out a lot of details, but it does give the gist of the mechanics of Fuzzy Logic. This page gives a tutorial on the basics of fuzzy logic:
http://www.mathworks.com/access/helpdesk_r13/help/toolbox/fuzzy/fuzzytu5.html

Was just reading over the posts related to fuzzy logic to refresh some of the material I learned back in college.
I found the MATLAB link helpful to explain the fuzzy membership sets.
After further googling, I'm now using this java jar for jFuzzyLogic http://jfuzzylogic.sourceforge.net/html/index.html
Just thought this might be of use to some folks out there.
Melanie

Here is the link to the PowerPoint presentation I was taught from. http://www.mil.ufl.edu/courses/eel5666/handouts/Spring09/fuzzy.pdf (http://www.mil.ufl.edu/courses/eel5666/handouts/Spring09/fuzzy.pdf)
EDIT: sorry the thing is black and white. Somebody must have changed the presentation without thinking of the graph.

Was just reading over the posts related to fuzzy logic to refresh some of the material I learned back in college.
I found the MATLAB link helpful to explain the fuzzy membership sets.
After further googling, I'm now using this java jar for jFuzzyLogic http://jfuzzylogic.sourceforge.net/html/index.html
Just thought this might be of use to some folks out there.
Melanie
WOW, this open source Java toolkit for Fuzzy Logic and reading the content of this post may was part of my saving grace for a demo today to the customer.
And this thread helped to explain the differences between case based reasoning and fuzzy logic, which I was also able to intelligently explain to our customer today.
I'd just like to say thanks to the folks on this site. You're all awesome.