home Forums # Technical Support Three Membership Functions in antecedent

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2730
    Unknown
    Member

    Hi,

    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.

    #2732
    Unknown
    Member

    Additional 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 error

    and 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

    #2762

    Hi,

    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.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.