-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in SmallestOfMaximum? #9
Comments
Hi Chris, Thanks for your report. The code is actually fine. The difference is in the comparison Say you have this:
The smaller of maximum should get the first (left to right) x coordinate where y is maximum, so you iterate and change only when you find a The largest of maximum should get the last (left to right) x coordinate where y is maximum, so you iterate and change when This is maybe easier to see in QtFuzzyLite, just make sure to use Trapezoid terms instead of Triangle terms. Does this answer your question? Cheers. |
Oh, I see what you mean, Chris! x = maximum - (i + 0.5) * dx |
Oh yes, that's a very subtle change to do Ge rather than Gt, didn't notice that! Makes sense. I'm in the final stages of my "fuzzyverylite" extension after getting a bit more time to have another look. It uses the Python library to parse the FLL, and then spits out C++ code to perform the calculations. I've managed to replicate one of our models in only 23KB of binary so far. I'll send it your way when I'm done with it for academic interest! Heads up, I noticed in my last push over Christmas that pyfuzzylite couldn't load one of our FLLs successfully. I'll make another bug report if the same still happens. |
I was just reading through the defuzzifiers, when I noticed that the code for SmallestOfMaximum is the same as LargestOfMaximum. The only difference is the initial value of
x_smallest
. I think the for-loop is supposed to go fromresolution
down to0
rather than0
toresolution
.Am I missing something?
pyfuzzylite/fuzzylite/defuzzifier.py
Line 186 in 28c75b3
The text was updated successfully, but these errors were encountered: