资 源 简 介
For some questions, YES and NO are not the unique possible answers.
Is it cold today?
* Yes.
* No.
* Really could.
* Kind of.
* Errrr...
* Not that could.
To model this kind of situation, we can use Fuzzy Logic.
Nuvem is a Fuzzy Logic Engine for Actionscript 3.
Usage:
Create the membership functions (fuzzification)
var hot:Function = FuzzyEngine.createLinearMembershipFunction(20, 40);var warm:Function = FuzzyEngine.createTriangularMembershipFunction(10, 20, 30);var cold:Function = FuzzyEngine.createLinearMembershipFunction(20, 0);
Eval based on your rules
var value:Number = FuzzyEngine.eval( "(((TEMPERATURE IS HOT) OR (TEMPERATURE IS WARM)) AND NOT (TEMPERATURE IS COLD))", {TEMPERATURE:t}, // Input values to be fuzzyficated {HOT:hot, WARM:warm, COLD:cold} // Membership functions);
Defuzzificate it