You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The output of r.fuzzy.system does not label the raster correctly. The output result is a DCELL raster with values defined by the defuzzification rules, AND labels for each value that provide the fuzzy set values prior to the defuzzification. Those labels are incorrect. The numerical values may also be incorrect, but I need to dig into this further before I can be certain.
To Reproduce
Run a simple r.fuzzy.system and examine the outputs. Visually the output raster appears correct, but the labels assign the wrong fuzzy classes. I'm also concerned that the output is not just labeled incorrectly, but is also numerically incorrect.
Example to be run in nc_spm_08_grass7
# distance to major roads
g.region raster=roadsmajor
r.grow.distance -m input=roadsmajor distance=dist
# crisp result
cat <<EOF | r.reclass rules=- input=dist output=crisp0 thru 1500 = 1 near1500 thru 99999 = 2 farEOF
cat <<EOF > fuzzy.map# fuzzy maps for example% dist$ near {right; 1000, 2000; linear; 0; 1}$ far {left; 1000, 2000; linear; 0; 1}% _OUTPUT_ $ near {right; 40,60; linear; 0;1}$ far {left; 40,60; linear; 0;1}EOF
cat <<EOF > fuzzy.rules# fuzzy rules for example$ near { dist = near }$ far { dist = far }EOF
r.fuzzy.system -m maps=fuzzy.map rules=fuzzy.rules output=fuzzy
Expected behavior
Correct labeling
Screenshots
Crisp result
Fuzzy result
But, clicking near a road shows this:
Having both near=1.0 and far=1.0 is incorrect. That situation should never exist, because near = 1 output occurs when dist = near, which is defined as dist < 1000. From 1000 to 2000 dist is still near, but with membership < 1.0. Furthermore, output with far = 1 occurs when dist = far, which only occurs with full membeship (far = 1) for dist > 2000. The two do not overlap.
Examining the fuzzy_near and fuzzy_far maps made with the -m option to r.fuzzy.system verifies that the membership with fuzzy_far is 0 if you click near a road.
Finally, maximum fuzzy values are never equal to 1 (full membership) even when they should be - for example when fuzzy_near = 1 and fuzzy_far = 0, regardless of the implication, family, or defuz options selected. From this I question the correctness of the numerical results, not just the label results.
System description (please complete the following information):
Linux, GRASS GIS 7.8.2
The text was updated successfully, but these errors were encountered:
Rather than clicking to diagnose the bug, it can be seen via the CLI with r.what. Here we examine a few rasters twice - once on a road (dist = 0) and once > 3 km from a road.
Name of the addon
r.fuzzy.system
Describe the bug
The output of
r.fuzzy.system
does not label the raster correctly. The output result is a DCELL raster with values defined by the defuzzification rules, AND labels for each value that provide the fuzzy set values prior to the defuzzification. Those labels are incorrect. The numerical values may also be incorrect, but I need to dig into this further before I can be certain.To Reproduce
Run a simple
r.fuzzy.system
and examine the outputs. Visually the output raster appears correct, but the labels assign the wrong fuzzy classes. I'm also concerned that the output is not just labeled incorrectly, but is also numerically incorrect.Example to be run in
nc_spm_08_grass7
Expected behavior
Correct labeling
Screenshots
Crisp result
Fuzzy result
But, clicking near a road shows this:
Having both
near=1.0
andfar=1.0
is incorrect. That situation should never exist, becausenear = 1
output occurs whendist = near
, which is defined asdist < 1000
. From 1000 to 2000dist
is still near, but with membership < 1.0. Furthermore, output withfar = 1
occurs whendist = far
, which only occurs with full membeship (far = 1
) fordist > 2000
. The two do not overlap.Examining the
fuzzy_near
andfuzzy_far
maps made with the-m
option tor.fuzzy.system
verifies that the membership withfuzzy_far
is 0 if you click near a road.Finally, maximum fuzzy values are never equal to 1 (full membership) even when they should be - for example when
fuzzy_near = 1
andfuzzy_far = 0
, regardless of theimplication
,family
, ordefuz
options selected. From this I question the correctness of the numerical results, not just the label results.System description (please complete the following information):
Linux, GRASS GIS 7.8.2
The text was updated successfully, but these errors were encountered: