home Forums # Technical Support JAVA API Reply To: JAVA API

#1450

Hi allissonjorge,

The value you are obtaining is a defuzzified output value. If you want to see the fuzzy output value, the correct way would be:


Accumulated fuzzyOutput = outputVariable.fuzzyOutput();
for (Term term : fuzzyOutput){
Thresholded activatedTerm = (Thresholded)term;
System.out.println("Term: " + activatedTerm.getName() + ": " + activatedTerm.getThreshold());
}


However, you could also do: outputVariable.fuzzify(0.62999), which will return you a string corresponding to the fuzzification of such a value.

Have in mind that there is a difference between the two methods. The first method is the correct way to obtain the true fuzzy output value. The second will obtain a fuzzification from an already defuzzified output value, for which information will not be accurate. More specifically, the first method will return the fuzzy output of the variable, but the second method will defuzzify the output variable (yielding 0.629999) and then it is trying to obtain the original fuzzy output value from just 0.629999.

In QtFuzzyLite 5, you can see the difference between both values by clicking the output value label, which swaps the value $\tilde{y}$ to $\mu(y)$. The former is the fuzzy output value, the latter is the membership function of the defuzzified output value.