home Forums # Technical Support FuzzyLite 3.1: [syntax error] stack expected to contain the root, but contains

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1392
    Unknown
    Member

    Hello,

    I am using FuzzyLite 3.1 with the OMNeT++ simulator. When running a simulation I have been getting these kind of errors:

    [syntax error] stack expected to contain the root, but contains 0 nodes

    After searching I found that this error points to the file FuzzyAntecedent.cpp and particularly these lines:

    if (expressionStack.size() != 1) {
    std::ostringstream ex;
    ex << “[syntax error] stack expected to contain the root, but contains ”
    << expressionStack.size() << ” nodes”;
    throw fl::Exception(ex.str(), FL_AT);
    }
    The expressionStack is defined as:
    std::stack<FuzzyExpression*> expressionStack;

    What is the cause of the expressionStack = 0 error? What is the expressionStack used for?

    #1394

    Hi,

    I strongly recommend you use the new fuzzylite 5.0. It is in a much much better shape.

    The error you are having has to do with an invalid rule that is probably misspelled, or contains invalid characters. Again, fuzzylite 5.0 would give you more information about the error.

    Cheers.

    #1416
    Unknown
    Member

    Hi Juan,

    Thanks your reply. I recently updated to FuzzyLite 5.0. I updated my code to the new version from 3.1, and the code compiles fine without any errors and all the necessary include files are present in the OMNeT++ IDE. However, when starting my simulation at the OMNeT++ IDE, I get this linker error:

    <!> Error during startup: Cannot load library ‘/..inetmanet/src//libinet.so’: /../inetmanet/src//libinet.so: undefined symbol: _ZN2fl9TrapezoidC1ERKSsdddd.

    Libinet.so is a library file in which all the simulator code is loaded. It seems that it is not loading correctly the FuzzyLite library.

    I have added to the simulation project properties “OMNeT++ makemake->Additional objects to link with” the file libfuzzylite-static.a ( found in FuzzyLite-5.0/fuzzylite/release/bin), which was the library file that was created after compiling the FuzzyLite 5.0 as “./build.sh all”. I did not have any linker problems with the previous version 3.1.

    Do you have any ideas or hints how I could try to solve this problem?

    Thanks.

    #1418

    Hi,

    Your first problem is that it cannot load library libinet, probably due to setting the path wrong: /..inetmanet/src//libinet.so, perhaps it is ../inetmanet/src/libinet.so?

    If the Trapezoid symbol is undefined, the fuzzylite library is not being loaded. You should check the path to the library is correct and make sure you have only one fuzzylite library installed. Also, perhaps the fuzzylite library is not being loaded due to errors loading other libraries like libinet?

    #1419
    Unknown
    Member

    Hi Juan,

    Apparently the problem was simple. I had forgot to do a “make clean” for the simulation project INETMANET. After “make clean” and “make” there were many compilation errors. After I solved these errors the fuzzylite library was correctly loaded into the simulation framework, and started without any errors.

    When running the simulation I’ve been now getting runtime-errors, such as

    accumulation operator needed to accumulate AP: Accumulated none[Minimum(1.000,EXCELLENT)]

    but those are clearly related to the old vs new version updates.

    #1420
    Unknown
    Member

    Hi,

    Right now I am getting this runtime error (when omnet++ simulation is running) with the FuzzyLite 5.0:

    event #51428098, t=212.014939351788: fl::Exception: [syntax error] unable to parse the following expressions in antecedent <>.

    This happens after 212 seconds of simulated time. Before that everything works perfectly without errors.

    What could be the cause of this error? Same point in the code as in v. 3.1:

    if (expressionStack.size() != 1) {
    std::vector<std::string> errors;
    while (expressionStack.size() > 1) {
    Expression* expression = expressionStack.top();
    expressionStack.pop();
    errors.push_back(expression->toString());
    delete expression;
    }
    std::ostringstream ex;
    ex << “[syntax error] unable to parse the following expressions in antecedent <”
    << Op::join(errors, ” “) << “>”;
    throw fl::Exception(ex.str(), FL_AT);
    }

    #1421

    Hi,

    Can you please post the rules?

    #1424
    Unknown
    Member

    Hai juan please help.. I’m not able to bulid fuzzylit.lib for c++ with my visual studio 2012.. please help..

    #1445
    Unknown
    Member

    Hi,

    Apparently this was related to some memory errors of my own code and not related to the fuzzyLite library. Thanks for the help!

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