Forum Replies Created

Viewing 15 posts - 451 through 465 (of 467 total)
  • Author
    Posts
  • in reply to: 2D Surface and JPG Output #935
    Juan Rada-Vilela
    Juan Rada-Vilela
    Keymaster

    Hi Brian,

    As soon as I have time, I will try the Surface2D in Windows, but in Ubuntu Linux it is working just fine. The image formatting and internal details are handled by the Qt framework. Please, refer to the Qt documentation for precise implementation details. You may find below JPEG images at different resolutions for the same controller generated and saved directly from QtFuzzyLite v4.0 without any manipulation. The resolutions are 8×16, 13×15, 33×33 and 800×600 (units in pixels). You may set any resolution for the images, even when the increments are by 8px.

    8x16
    13x15
    33x33
    800x600

    Cheers.

    in reply to: QtFuzzylite Control screen input slider behaviour #933
    Juan Rada-Vilela
    Juan Rada-Vilela
    Keymaster

    Hi Brian,

    At the moment, the only option to fix the behaviour you are seeing is to increase the range of the QSliders and build from source, unfortunately. In version 5.0, it will be far easier to fix that without building from source. The behaviour you are seeing is somewhat necessary as both must be in sync: moving slider changes value, changing value moves slider.

    As for testing, I did not mean anything exhaustive whatsoever. Just making sure the issues you have mentioned have been addressed in 5.0 would be enough. I like very much the details, like the ones you have mentioned, that’s all.

    Cheers.

    in reply to: QtFuzzylite Control screen input slider behaviour #931
    Juan Rada-Vilela
    Juan Rada-Vilela
    Keymaster

    Hi Brian,

    thank you very much for your kind words and for taking the time to describe the issue. I totally agree with the behaviour that you expect. At the moment, my guess is that the value you are entering in the QDoubleSpinBox gets reflected in the QSlider, which cannot represent every floating-value that you enter and then rounds to the nearest possible value, which then triggers another signal to the QDoubleSpinBox and changes its value. As for the delta increments, I honestly cannot remember what I did for those. I think the delta increment changes according to the range of the variable, the resolution of the QSlider, or maybe both (range/resolution).

    At the moment, I am working on a new version of QtFuzzyLite from scratch, taking much more care on the details, and a much better design. I will address the issues you have mentioned in the new version, which I expect to release late February or early March. As soon as I have a working version, if you are interested, I could build the binaries for you so you can test it and let me know your suggestions. Otherwise, if you prefer to modify the source code of the current version, I think all you need to do is increase the range of the QSliders.

    If you have more feature requests, please feel free to post them! It is a good time since I am working many hours during the week on (qt)fuzzylite.

    Cheers,

    Juan.

    in reply to: Centre of Maximums Defuzzifier et al #928
    Juan Rada-Vilela
    Juan Rada-Vilela
    Keymaster

    Yes, your fuzzy logic controller would become a Takagi-Sugeno model, which matches your description of little computational complexity. However, have in mind that you need to model the output terms as Constant values. Otherwise, if you use Triangles or any other membership function, you would end up with an inverse tsukamoto controller, which is hardly any useful.

    in reply to: Centre of Maximums Defuzzifier et al #926
    Juan Rada-Vilela
    Juan Rada-Vilela
    Keymaster

    Hi Brian,

    thank you for your kind words and good ideas.

    I believe the defuzzifier you are after is the Weighted Average in fuzzylite, and you have to model the output terms as Constant values. In the example from the figure, you would model the OutputVariable using the following terms:
    NegativeLarge Constant -30
    NegativeMedium Constant -15
    NegativeSmall Constant -5
    Zero Constant 0
    PositiveSmall Constant 5
    PositiveMedium Constant 15
    PositiveLarge Constant 30

    Center of Maximum

    As for the initial screen, I will consider your suggestions for version 5.0. At the moment, you can skip it by pressing Escape, or surely modifying the source and building it again.

    Cheers,

    Juan.

    in reply to: fuzzylite in Eclipse #923
    Juan Rada-Vilela
    Juan Rada-Vilela
    Keymaster

    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
    Juan Rada-Vilela
    Juan Rada-Vilela
    Keymaster

    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
    Juan Rada-Vilela
    Juan Rada-Vilela
    Keymaster

    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
    Juan Rada-Vilela
    Juan Rada-Vilela
    Keymaster

    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
    Juan Rada-Vilela
    Juan Rada-Vilela
    Keymaster

    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
    Juan Rada-Vilela
    Juan Rada-Vilela
    Keymaster

    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
    Juan Rada-Vilela
    Juan Rada-Vilela
    Keymaster

    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
    Juan Rada-Vilela
    Juan Rada-Vilela
    Keymaster

    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
    Juan Rada-Vilela
    Juan Rada-Vilela
    Keymaster

    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
    Juan Rada-Vilela
    Juan Rada-Vilela
    Keymaster

    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 15 posts - 451 through 465 (of 467 total)