Forum Replies Created

Viewing 10 posts - 461 through 470 (of 472 total)
  • Author
    Posts
  • in reply to: fuzzylite in Eclipse #923

    Hi,

    thank you very much for your kind words and details setting up fuzzylite in Eclipse.

    To complement your details, I think the Environment variable (step 7) is not necessary. As long as the Library Path points to where libfuzzylite.so (fuzzylite.dll) can be found, it should not be necessary to set an environment variable.

    Also, if you prefer to use static linking, you can use “fuzzylite-static” in the libraries tab and then the library will be included inside your executable, for which you would not need to include any fuzzylite library files.

    Thanks again for the details of your post 🙂

    in reply to: Equivalent of fismain.c from MATLAB distribution #918

    Dear Witold,

    thank you for your review, the example, and your feedback on the output that you expect. I greatly appreciate the time you took to provide very useful feedback. I will fix the current implementation to show the output that you want. I expect to release v4.1 early February.

    Cheers,

    Juan.

    in reply to: Equivalent of fismain.c from MATLAB distribution #877

    Dear Witold,

    thank you for your information. I have finished its implementation today and it is looking pretty neat. The usage is:

    fuzzylite -i engine.fll -d inputs.fld -o outputs.fld

    The output is:

    #@Engine: name; @InputVariable: name; ... @OutputVariable: name;
    inputValue1 inputValue2 ... outputValue1 outputValue2
    .
    .
    .
    

    I was unsure whether to only export the values of the output variables, but I guess it does not make sense to only export the output values without their respective input values. Could you confirm the output I mention is satisfactory?

    I expect to release version 4.1 in the upcoming weeks, and this feature will be included.

    Cheers,

    Juan.

    in reply to: Reading/Writing FIS files using FuzzyLite #872

    What you require is not too hard and you do not need to build fuzzylite from source to achieve so.

    Roughly, in SomeFile.cpp:

    
    #include <fl/Headers.h>
    
    int main(int argc, char** argv){
       std::string fisEngine = readFromSomeFile("xxx.fis");
       std::vector<std::vector<fl::scalar> > inputs = readFromSomeFileAndParse("xxx.dat");
       fl::Engine* engine = FisImporter().fromString(fisEngine);
       for (std::size_t i = 0 ; i < inputs.size(); ++i){
           for (std::size_t x = 0 ; x < inputs.at(i).size(); ++x){
                engine->getInputVariable(x)->setInputValue(inputs.at(i).at(x));
           }
           engine->process();
           for (int i = 0 ; i < engine->numberOfOutputVariables(); ++i){
              fl::scalar output = engine->getOutputVariable(i)->defuzzify(); 
              writeToSomeFile(output + " ");
           }
           writeToSomeFile(output + "\n");
    }
    

    You have to implement yourself the read and write functions and fix some details.

    g++ SomeFile.cpp -I/path/to/fuzzylite/fuzzylite -L/path/to/fuzzylite/fuzzylite/bin -lfuzzylite

    in reply to: Equivalent of fismain.c from MATLAB distribution #871

    Dear Witold,

    Another person recently requested the same feature in the forums. I will definitely incorporate such a simple function in the next version. I had no idea about it because I have rarely used Matlab for fuzzy logic control, or anything else for that matter.

    Anyway, what you require is not too hard and you do not need to build fuzzylite from source to achieve so.

    Roughly, in SomeFile.cpp:

    
    #include <fl/Headers.h>
    
    int main(int argc, char** argv){
       std::string fisEngine = readFromSomeFile("xxx.fis");
       std::vector<std::vector<fl::scalar> > inputs = readFromSomeFileAndParse("xxx.dat");
       fl::Engine* engine = FisImporter().fromString(fisEngine);
       for (std::size_t i = 0 ; i < inputs.size(); ++i){
           for (std::size_t x = 0 ; x < inputs.at(i).size(); ++x){
                engine->getInputVariable(x)->setInputValue(inputs.at(i).at(x));
           }
           engine->process();
           for (int i = 0 ; i < engine->numberOfOutputVariables(); ++i){
              fl::scalar output = engine->getOutputVariable(i)->defuzzify(); 
              writeToSomeFile(output + " ");
           }
           writeToSomeFile(output + "\n");
    }
    

    You have to implement yourself the read and write functions and fix some details.

    g++ SomeFile.cpp -I/path/to/fuzzylite/fuzzylite -L/path/to/fuzzylite/fuzzylite/bin -lfuzzylite

    in reply to: Reading/Writing FIS files using FuzzyLite #870

    Hi CF,

    Another person has asked for the same fis.c and fismain.c file, but now I understand what you want to do!
    I will definitely add that feature to fuzzylite soonish and let you know.

    Cheers,

    in reply to: qtfuzzylite Linking problem #853

    Hi,

    thank you for providing feedback!

    Indeed, there were errors building fuzzylite 4.0 using -DFL_USE_FLOAT=on.
    I have fixed them and updated the sources.
    Please, download the sources again from http://www.fuzzylite.com/downloads and let me know if your issue was resolved.

    in reply to: qtfuzzylite Linking problem #849

    Hi,

    yes, fl-shared is the path to the target library.

    I would recommend you make sure to clean CMake derived files using the clean.sh file.
    Also, I think you will have trouble building from source using -DFL_USE_FLOAT=ON. If you do, please use double precision instead by setting -DFL_USE_FLOAT=OFF or just not using the flag -DFL_USE_FLOAT (by default is OFF). I am working on some compiling issues I found using floats instead of double.

    in reply to: Reading/Writing FIS files using FuzzyLite #843

    Hi,

    fuzzylite does not deal with Files, and I think I will keep it that way for the foreseeable future. However, I will consider using custom vectors for the next version.

    You need to investigate how to read and write files from your computer using C++. I have done reading files using std::ifstream and std::getline. For every line read, you can use std::istringstream as a tokenizer that reads the line and gets each of the values in the line and stores them in a matrix. Afterwards:
    1) traverse the matrix using the values to prepare the input variables (using InputVariable::setInputValue)
    2) call method Engine::process
    3) defuzzify the values of each output variable and store them in the matrix
    4) Write to file the matrix or part of the matrix

    Also, I have changed the title of the post to reflect better its contents.

    Cheers.

    in reply to: Reading/Writing FIS files using FuzzyLite #833

    Hi,

    I do not know what the goal is for fis.c or fismain.c. It seems to me that you want to have the data in FLD format stored in a two-dimensional matrix. You can do that if you parse the results obtained with the FldExporter.

    However, if you want custom input vectors, you can have two matrices, one for inputs and the other for outputs. Then, you can easily create both matrices yourself using fuzzylite. You do not need the fis.c or fismain.c to do it for you, roughly, you can do it as follows.

    for every input vector v:
       for every input variable i:
         i.setInputValue(v[i]);
       engine.process();
     for every output variable o:
       w[o] = o.defuzzify();

    where v is a row of the input matrix, w is a row of the output matrix.

Viewing 10 posts - 461 through 470 (of 472 total)