home › Forums › # Technical Support › Three Membership Functions in antecedent
Tagged: Antecedents, Engine Load, Rule
- This topic has 2 replies, 2 voices, and was last updated 5 years, 7 months ago by
Juan Rada-Vilela (admin).
-
AuthorPosts
-
January 19, 2018 at 13:13 #2730
Unknown
MemberHi,
I’m trying to build an Engine, and I’m writing rules like this one:
if laserLeftZone is F and laserFrontZone is N and laserRightZone is VN then linearVelocity is Backwards and angularVelocity is fastLeft
but when I try to load that ruleBlock in my engine, NullPointerException appears suddenly. so my question is, Is fuzzylite ready for more than 2 propositions in antecedent?, If so, how should I write it to be accepted?.
Thank you so much.
January 20, 2018 at 00:22 #2732Unknown
MemberAdditional Information..
the debugger shows this output:/src/rule/Antecedent.cpp::load[224]:Antecedent: (laserLeftZone is VF and laserFrontZone is VF) and laserRightZone is VF
/src/rule/Antecedent.cpp::load[242]:Postfix: laserLeftZone is VF laserFrontZone is VF and laserRightZone is VF and
/src/rule/Antecedent.cpp::load[266]:Token <laserLeftZone> is variable
/src/rule/Antecedent.cpp::load[274]:Token <is> is keyword
/src/rule/Antecedent.cpp::load[298]:Token <VF> is term
/src/rule/Antecedent.cpp::load[266]:Token <laserFrontZone> is variable
/src/rule/Antecedent.cpp::load[274]:Token <is> is keyword
/src/rule/Antecedent.cpp::load[298]:Token <VF> is term
/src/rule/Antecedent.cpp::load[322]:Subtree: and(laserLeftZone is VF) (laserFrontZone is VF)
/src/rule/Antecedent.cpp::load[266]:Token <laserRightZone> is variable
/src/rule/Antecedent.cpp::load[274]:Token <is> is keyword
/src/rule/Antecedent.cpp::load[298]:Token <VF> is term
/src/rule/Antecedent.cpp::load[322]:Subtree: and(and) (laserRightZone is VF) maybe the errorand when the engine is trying to evaluate the rule, and the debugger shows me this:
/src/Exception.cpp::Exception[57]:[conjunction error] the following rule requires a conjunction operator:
laserLeftZone is VF and laserFrontZone is VF and laserRightZone is VF
{at /src/rule/Antecedent.cpp::activationDegree() [line:114]}
terminate called after throwing an instance of ‘fl::Exception’
what(): [conjunction error] the following rule requires a conjunction operator:
laserLeftZone is VF and laserFrontZone is VF and laserRightZone is VF
{at /src/rule/Antecedent.cpp::activationDegree() [line:114]}and I believe that the rule was written correctly
January 31, 2018 at 18:24 #2762Juan Rada-Vilela (admin)
KeymasterHi,
thanks for your question.
When you have disjunctions (i.e., or) or conjunctions (i.e., and) in the rules, you need to specify conjunction and disjunction operators for the rule blocks. Check and play with QtFuzzyLite.
Cheers.
-
AuthorPosts
- You must be logged in to reply to this topic.