Skip to content

Commit 9a587e4

Browse files
authored
Code and doc fixes for fuzzy addons (#175)
Reviewed & Co-authored-by: Markus Neteler <neteler@gmail.com>
1 parent 83e8a26 commit 9a587e4

File tree

7 files changed

+151
-130
lines changed

7 files changed

+151
-130
lines changed

grass7/raster/r.fuzzy.logic/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ int main(int argc, char *argv[])
4848
G_add_keyword(_("fuzzy logic"));
4949
module->description =
5050
_("Performs logical operations on membership images created with "
51-
"r.fuzzy or different method. Use families for fuzzy logic.");
51+
"r.fuzzy.set or different method. Use families for fuzzy logic.");
5252

5353
par_inputx = G_define_standard_option(G_OPT_R_INPUT);
5454
par_inputx->description = _("x operand (membership map)");
@@ -68,7 +68,7 @@ int main(int argc, char *argv[])
6868
par_operation->options = "AND,OR,NOT,IMP";
6969
par_operation->answer = "AND";
7070
par_operation->multiple = NO;
71-
par_operation->required = YES;
71+
par_operation->required = NO;
7272
par_operation->description = _("Fuzzy logic operation");
7373

7474
par_family = G_define_option();
@@ -77,7 +77,7 @@ int main(int argc, char *argv[])
7777
par_family->options = "Zadeh,product,drastic,Lukasiewicz,Fodor,Hamacher";
7878
par_family->answer = "Zadeh";
7979
par_family->multiple = NO;
80-
par_family->required = YES;
80+
par_family->required = NO;
8181
par_family->description = _("Fuzzy logic family");
8282

8383
if (G_parser(argc, argv))

grass7/raster/r.fuzzy.logic/r.fuzzy.logic.html

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ <h2>OPTIONS</h2>
55
range 0 :1 and may require null values. Otherwise program will print error
66
message and stops.
77
</dd>
8-
<dt><b>xmap</b></dt>
8+
<dt><b>ymap</b></dt>
99
<dd>Name of input y membership operand. This map must be of type FCELL with
1010
range 0 :1 and may require null values. Otherwise program will print error
1111
message and stops. This map is optional bit is required for all operation except
@@ -47,40 +47,46 @@ <h2>OPTIONS</h2>
4747
<h2>OUTPUTS</h2>
4848
<dl>
4949
<dt><b>output</b></dt>
50-
<dd>Map containing result of two-values operations. Multivalued operations will
51-
be available in the future. Map is always of type FCELLS and contains values
50+
<dd>Map containing result of two-values operations.
51+
Map is always of type FCELL and contains values
5252
from 0 (no membership) to 1 (full membership). Values between 0 and 1 indicate
5353
partial membership</dd>
5454
</dl>
5555

5656
<h2>SEE ALSO</h2>
5757

5858
<em>
59-
<a href="r.fuzzy.html">r.fuzzy</a>,
59+
<a href="r.fuzzy.set.html">r.fuzzy.set</a> addon,
60+
<a href="r.fuzzy.system.html">r.fuzzy.system</a> addon,
6061
<a href="r.mapcalc.html">r.mapcalc</a>
6162
</em>
6263

6364

6465
<h2>REFERENCES</h2>
6566

66-
Zadeh, L.A. (1965). Fuzzy sets. Information and Control 8 (3): 338–353.
67-
doi:10.1016/S0019-9958(65)90241-X. ISSN 0019-9958.<p>
67+
<ul>
68+
<li>Jasiewicz, J. (2011). A new GRASS GIS fuzzy inference system for massive data analysis.
69+
Computers & Geosciences (37) 1525-1531. DOI <a href="https://doi.org/10.1016/j.cageo.2010.09.008">https://doi.org/10.1016/j.cageo.2010.09.008</a>
70+
71+
<li>Zadeh, L.A. (1965). "Fuzzy sets". Information and Control 8 (3): 338-353.
72+
<a href="https://doi.org/10.1016/S0019-9958(65)90241-X"><a href="https://doi.org/10.1016/S0019-9958(65)90241-X"</a>. ISSN 0019-9958.
6873

69-
Nov&aacute;k, Vil&eacute;m (1989). Fuzzy Sets and Their Applications. Bristol: Adam Hilger.
70-
ISBN 0-85274-583-4.<p>
74+
<li>Novák, Vilém (1989). Fuzzy Sets and Their Applications. Bristol: Adam Hilger.
75+
ISBN 0-85274-583-4.
7176

72-
Klir, George J.; Yuan, Bo (1995). Fuzzy sets and fuzzy logic: theory and
73-
applications. Upper Saddle River, NJ: Prentice Hall PTR. ISBN 0-13-101171-5.<p>
77+
<li>Klir, George J.; Yuan, Bo (1995). Fuzzy sets and fuzzy logic: theory and
78+
applications. Upper Saddle River, NJ: Prentice Hall PTR. ISBN 0-13-101171-5.
7479

75-
Klir, George J.; St Clair, Ute H.; Yuan, Bo (1997). Fuzzy set theory:
80+
<li>Klir, George J.; St Clair, Ute H.; Yuan, Bo (1997). Fuzzy set theory:
7681
foundations and applications. Englewood Cliffs, NJ: Prentice Hall. ISBN
77-
0133410587.<p>
82+
0133410587.
7883

79-
Meyer D, Hornik K (2009a). Generalized and Customizable Sets in R. Journal of
80-
Statistical Software, 31(2), 1-27. URL https://www.jstatsoft.org/v31/i02/.<p>
84+
<li>Meyer D, Hornik K (2009a). Generalized and Customizable Sets in R. Journal of
85+
Statistical Software, 31(2), 1-27. DOI <a href="https://doi.org/10.18637/jss.v031.i02">https://doi.org/10.18637/jss.v031.i02</a>
8186

82-
Meyer D, Hornik K (2009b). sets: Sets, Generalized Sets, and Customizable Sets.
83-
R package version, URL https://CRAN.R-project.org/package=sets.<p>
87+
<li>Meyer D, Hornik K (2009b). sets: Sets, Generalized Sets, and Customizable Sets.
88+
R~package version~1.0, URL <a href="http://CRAN.R-project.org/package=sets">http://CRAN.R-project.org/package=sets</a>.
89+
</ul>
8490

8591
<h2>AUTHOR</h2>
8692
Jarek Jasiewicz

grass7/raster/r.fuzzy.set/main.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ int main(int argc, char *argv[])
7171
par_side->options = "both,left,right";
7272
par_side->answer = "both";
7373
par_side->multiple = NO;
74-
par_side->required = YES;
74+
par_side->required = NO;
7575
par_side->description = _("Fuzzy range");
7676

7777
par_type = G_define_option();
@@ -80,27 +80,27 @@ int main(int argc, char *argv[])
8080
par_type->options = "Linear,S-shaped,J-shaped,G-shaped";
8181
par_type->answer = "S-shaped";
8282
par_type->multiple = NO;
83-
par_type->required = YES;
83+
par_type->required = NO;
8484
par_type->description = _("Type of fuzzy boundaries");
8585
par_type->guisection = _("Default options");
8686

8787
par_shape = G_define_option();
8888
par_shape->key = "shape";
8989
par_shape->type = TYPE_DOUBLE;
90-
par_shape->options = "-1,1";
90+
par_shape->options = "-1-1";
9191
par_shape->answer = "0.";
9292
par_shape->multiple = NO;
93-
par_shape->required = YES;
93+
par_shape->required = NO;
9494
par_shape->description = _("Shape modifier: -1 to 1");
9595
par_shape->guisection = _("Default options");
9696

9797
par_height = G_define_option();
9898
par_height->key = "height";
9999
par_height->type = TYPE_DOUBLE;
100-
par_height->options = "0,1";
100+
par_height->options = "0-1";
101101
par_height->answer = "1.";
102102
par_height->multiple = NO;
103-
par_height->required = YES;
103+
par_height->required = NO;
104104
par_height->description = _("Membership height: 0 to 1");
105105
par_height->guisection = _("Default options");
106106

grass7/raster/r.fuzzy.set/r.fuzzy.set.html

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ <h2>OPTIONS</h2>
55
require null values.
66
</dd>
77
<dt><b>points</b></dt>
8-
<dd>A list containing 4 (A,B,C,D) or 2 A,B) points defining set boundaries.
9-
Points must not to be in map range, but it may lead to only 0 o 1 membership for
10-
the whole map. For "both" side parameters range between A and D defines base,
8+
<dd>A list containing 4 (A,B,C,D) or 2 (A,B) points defining set boundaries.
9+
Points do not have to be in map range, but this may lead to only 0 o 1 membership for
10+
the whole map. For side parameter "both", range between A and D defines base,
1111
but range between B and C core of the fuzzy set. Between A and B and C and D are
1212
set's boundaries. If side is "both" it require 4 points, else 2 points.
1313
<center>
@@ -16,7 +16,7 @@ <h3>Fuzzy set definition:</h3>
1616
</center>
1717
</dd>
1818
<dt><b>side</b></dt>
19-
<dd>Option indicate if set is fuzzified of both sides (both), left or right
19+
<dd>Option indicates if set is fuzzified of both sides (both), left or right
2020
side. See description for details.
2121
<center>
2222
<h3>Boundary definition:</h3>
@@ -42,7 +42,7 @@ <h2>FUZZY SET PARAMETERS</h2>
4242
<dt><b>shape</b></dt>
4343
<dd>Optional shape modifier. Range from -1 to 1. The default value is 0 and
4444
should not be changed in most of the time. The negative values indicate more
45-
dilatant set, the positive values more concentrate set. See description for
45+
dilatant set, the positive values more concentrate set. See NOTES for
4646
details.
4747
<center>
4848
<h3>Impact of shape parameter on shape boundary:</h3>
@@ -51,22 +51,22 @@ <h3>Impact of shape parameter on shape boundary:</h3>
5151
</dd>
5252
<dt><b>height</b></dt>
5353
<dd>Optional height modifier. Range from 0 to 1. The default value is 1 and
54-
indicate full membership between points B and C. If height is lesser than one the
54+
indicates full membership. If height is less than one the
5555
maximum membership is equal to height. See image: Fuzzy set definition.</dd>
5656
</dl>
5757

5858
<h2>DESCRIPTION</h2>
5959

6060
<h4>Definition of fuzzy set</h4>
6161
Fuzzy sets are sets whose elements have degrees of membership. Zadeh (1965)
62-
introduced Fuzzy sets as an extension of the classical notion of set. Classical
62+
introduced Fuzzy sets as an extension of the classical notion of sets. Classical
6363
membership of elements in a set are binary terms: an element either belongs or
6464
does not belong to the set. Fuzzy set theory use the gradual assessment of the
6565
membership of elements in a set. A membership function valued in the real unit
6666
interval [0, 1]. Classical sets, are special cases of the membership functions
6767
of fuzzy sets, if the latter only take values 0 or 1. Classical sets are in
68-
fuzzy set theory usually called crisp sets. The fuzzy set theory can be used in
69-
a wide range of domains in which information is imprecise, such as most of the
68+
fuzzy set theory usually called crisp sets. Fuzzy set theory can be used in
69+
a wide range of domains in which information is imprecise, including many
7070
GIS operations.
7171

7272

@@ -78,10 +78,10 @@ <h4>Calculation of boundary shape</h4>
7878
<b>Linear:</b> the membership is calculated according following equation:<br>
7979
<pre><code>
8080
value <= A -> x = 0
81-
A< value > B -> x = (value-A)/(B-A)
81+
A < value > B -> x = (value-A)/(B-A)
8282
B <= value >= C -> x = 1
83-
C< value > D -> x = (D-value)/(D-C)
84-
value >= D -> x = 0
83+
C < value > D -> x = (D-value)/(D-C)
84+
value >= D -> x = 0
8585

8686
where x: membership
8787
</code></pre>
@@ -117,31 +117,37 @@ <h4>Calculation of boundary shape</h4>
117117
<h2>SEE ALSO</h2>
118118

119119
<em>
120-
<a href="r.fuzzy.logic.html">r.fuzzy.logic</a>,
120+
<a href="r.fuzzy.logic.html">r.fuzzy.logic</a> addon,
121+
<a href="r.fuzzy.system.html">r.fuzzy.system</a> addon,
121122
<a href="r.mapcalc.html">r.mapcalc</a>,
122123
</em>
123124

124125

125126
<h2>REFERENCES</h2>
126127

127-
<p>Zadeh, L.A. (1965). "Fuzzy sets". Information and Control 8 (3): 338–353.
128-
doi:10.1016/S0019-9958(65)90241-X. ISSN 0019-9958.</P>
128+
<ul>
129+
<li>Jasiewicz, J. (2011). A new GRASS GIS fuzzy inference system for massive data analysis.
130+
Computers & Geosciences (37) 1525-1531. DOI <a href=https://doi.org/10.1016/j.cageo.2010.09.008">https://doi.org/10.1016/j.cageo.2010.09.008</a>
129131

130-
<p>Novák, Vilém (1989). Fuzzy Sets and Their Applications. Bristol: Adam Hilger.
131-
ISBN 0-85274-583-4.</P>
132+
<li>Zadeh, L.A. (1965). "Fuzzy sets". Information and Control 8 (3): 338–353.
133+
<a href="https://doi.org/10.1016/S0019-9958(65)90241-X"><a href="https://doi.org/10.1016/S0019-9958(65)90241-X"</a>.
132134

133-
<p>Klir, George J.; Yuan, Bo (1995). Fuzzy sets and fuzzy logic: theory and
134-
applications. Upper Saddle River, NJ: Prentice Hall PTR. ISBN 0-13-101171-5.</P>
135+
<li>Novák, Vilém (1989). Fuzzy Sets and Their Applications. Bristol: Adam Hilger.
136+
ISBN 0-85274-583-4.
135137

136-
<p>Klir, George J.; St Clair, Ute H.; Yuan, Bo (1997). Fuzzy set theory:
138+
<li>Klir, George J.; Yuan, Bo (1995). Fuzzy sets and fuzzy logic: theory and
139+
applications. Upper Saddle River, NJ: Prentice Hall PTR. ISBN 0-13-101171-5.
140+
141+
<li>Klir, George J.; St Clair, Ute H.; Yuan, Bo (1997). Fuzzy set theory:
137142
foundations and applications. Englewood Cliffs, NJ: Prentice Hall. ISBN
138-
0133410587.</P>
143+
0133410587.
139144

140-
<p>Meyer D, Hornik K (2009a). \Generalized and Customizable Sets in R." Journal
141-
of Statistical Software, 31(2), 1{27. URL http://www.jstatsoft.org/v31/i02/.</P>
145+
<li>Meyer D, Hornik K (2009a). Generalized and Customizable Sets in R. Journal of
146+
Statistical Software, 31(2), 1-27. DOI <a href="https://doi.org/10.18637/jss.v031.i02">https://doi.org/10.18637/jss.v031.i02</a>
142147

143-
Meyer D, Hornik K (2009b). sets: Sets, Generalized Sets, and Customizable Sets.
144-
R~package version~1.0, URL http://CRAN.R-project.org/package=sets.<p>
148+
<li>Meyer D, Hornik K (2009b). sets: Sets, Generalized Sets, and Customizable Sets.
149+
R~package version~1.0, URL <a href="http://CRAN.R-project.org/package=sets">http://CRAN.R-project.org/package=sets</a>.
150+
</ul>
145151

146152
<h2>AUTHOR</h2>
147153
Jarek Jasiewicz

grass7/raster/r.fuzzy.system/flood.map

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $ veryfar {left; 200,300; sshaped; 0; 1}
1313

1414
%accum_abs
1515
$ low {right; 500,5000; sshaped; 0; 1}
16-
$ $ high {left; 500,5000; sshaped; 0; 1}
16+
$ high {left; 500,5000; sshaped; 0; 1}
1717

1818
#output map
1919

grass7/raster/r.fuzzy.system/main.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* MODULE: r.fuzzy.system
44
* AUTHOR(S): Jarek Jasiewicz <jarekj amu.edu.pl>
5-
* PURPOSE: Full fuzzy logic standalone classification system with few fuzzy logic families
5+
* PURPOSE: Fuzzy logic classification system with several fuzzy logic families
66
* implication and defuzzification and methods.
77
* COPYRIGHT: (C) 1999-2010 by the GRASS Development Team
88
*
@@ -62,7 +62,7 @@ int main(int argc, char **argv)
6262
G_add_keyword(_("raster"));
6363
G_add_keyword(_("fuzzy logic"));
6464
module->description =
65-
_("Full fuzzy logic standalone classification system with few fuzzy "
65+
_("Fuzzy logic classification system with multiple fuzzy "
6666
"logic families implication and defuzzification and methods.");
6767

6868
file_vars = G_define_standard_option(G_OPT_F_INPUT);
@@ -80,7 +80,7 @@ int main(int argc, char **argv)
8080
par_family->type = TYPE_STRING;
8181
par_family->options = "Zadeh,product,drastic,Lukasiewicz,Fodor,Hamacher";
8282
par_family->answer = "Zadeh";
83-
par_family->required = YES;
83+
par_family->required = NO;
8484
par_family->description = _("Fuzzy logic family");
8585
par_family->guisection = _("Advanced options");
8686

@@ -90,7 +90,7 @@ int main(int argc, char **argv)
9090
par_defuzzify->options =
9191
"centroid,bisector,min_of_highest,max_of_highest,mean_of_highest";
9292
par_defuzzify->answer = "bisector";
93-
par_defuzzify->required = YES;
93+
par_defuzzify->required = NO;
9494
par_defuzzify->description = _("Defuzzification method");
9595
par_defuzzify->guisection = _("Advanced options");
9696

@@ -99,15 +99,15 @@ int main(int argc, char **argv)
9999
par_implication->type = TYPE_STRING;
100100
par_implication->options = "minimum,product";
101101
par_implication->answer = "minimum";
102-
par_implication->required = YES;
102+
par_implication->required = NO;
103103
par_implication->description = _("Implication method");
104104
par_implication->guisection = _("Advanced options");
105105

106106
par_resolution = G_define_option();
107107
par_resolution->key = "res";
108108
par_resolution->type = TYPE_INTEGER;
109109
par_resolution->answer = "100";
110-
par_resolution->required = YES;
110+
par_resolution->required = NO;
111111
par_resolution->description = _("Universe resolution");
112112
par_resolution->guisection = _("Advanced options");
113113

0 commit comments

Comments
 (0)