[GRASS-SVN] r48297 - grass-addons/raster/r.fuzzy
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Sep 15 04:24:18 EDT 2011
Author: hamish
Date: 2011-09-15 01:24:17 -0700 (Thu, 15 Sep 2011)
New Revision: 48297
Modified:
grass-addons/raster/r.fuzzy/description.html
grass-addons/raster/r.fuzzy/main.c
Log:
add a module description,
fix malformed parser options,
fix html and english bugs in the help page.
Modified: grass-addons/raster/r.fuzzy/description.html
===================================================================
--- grass-addons/raster/r.fuzzy/description.html 2011-09-14 19:27:09 UTC (rev 48296)
+++ grass-addons/raster/r.fuzzy/description.html 2011-09-15 08:24:17 UTC (rev 48297)
@@ -2,8 +2,8 @@
<p>
<DT><b>input</b></DT>
-<DD>Name of input raster map to be fuzified. This map may be of any type and may
-require null values.
+<DD>Name of input raster map to be fuzzified. This map may be of any type and may
+contain null values.
</DD>
<p>
@@ -12,63 +12,57 @@
Points must not to be in map range, but it may lead to only 0 o 1 membership for
the whole map. For "both" side parameters range between A and D defines base,
but range between B and C core of the fuzzy set. Between A and B and C and D are
-set's boundaries. If side is "both" it require 4 points, else 2 points.</DD>
+the set's boundaries. If side is "both" it require 4 points, else 2 points.</DD>
<p>
-<center>
<h3>Fuzzy set definition:</h3>
<img src=set.png border=1><br>
-</center>
<DT><b>side</b></DT>
-<DD>Option indicat if set is fuzzified ob both side s (both), left or right
-side. See description for details.</DD>
+<DD>This option indicates if the set is fuzzified on both sides (both),
+or the left or right side. See description for details.</DD>
<p>
<h2>OUTPUTS</h2>
<DT><b>output</b></DT>
-<DD>Map containing membership value of original map. Map is alvays of type
-FCELLS and contains values from 0 (no membership) to 1 (full membership). Values
+<DD>Map containing membership value of original map. Map is always of type
+FCELL and contains values from 0 (no membership) to 1 (full membership). Values
between 0 and 1 indicate partial membership</DD>
<p>
<h2>FUZZY SET PARAMETERS</h2>
<DT><b>boundary</b></DT>
-<DD>Parameter definied the shape of the fuzzy boundary. The default and most
+<DD>This parameter defines the shape of the fuzzy boundary. The default and most
popular is S-shaped, linear, J-shaped and G-shaped boundaries are also
-available. The same boundaires are appled to the both sides.</DD>
+available. The same boundaries are applied to both sides.</DD>
<p>
-<center>
-<h3>Boundary definition:<h3>
+<h3>Boundary definition:</h3>
<img src=boundary.png border=1><br>
-</center
<DT><b>shape</b></DT>
<DD>Optional shape modifier. Range from -1 to 1. The default value is 0 and
-shoud not be changed in most of the time. The negative values indicate more
-dilatant set, the positive values more concentrate set. See description for
+in most cases should not be changed. Negative values indicate a more
+dilettante set, positive values a more concentrated set. See description for
details.</DD>
<p>
-<center>
-<h3>Impact of shape parameter on shape boundary:<h3>
+<h3>Impact of shape parameter on shape boundary:</h3>
<img src=shape.png border=1><br>
-</center
<DT><b>height</b></DT>
<DD>Optional height modifier. Range from 0 to 1. The default value is 1 and
-indicate full membership beteen points B and C. If height is lesser than one the
-maximum memebrship is equal to height. See image: Fuzzy set definition.</DD>
+indicates full membership between points B and C. If height is less than one the
+maximum membership is equal to height. See image: Fuzzy set definition.</DD>
<p>
-</DL>
<h2>DESCRIPTION</h2>
<P>
<H4>Definition of fuzzy set</H4>
+
Fuzzy sets are sets whose elements have degrees of membership. Zadeh (1965)
introduced Fuzzy sets as an extension of the classical notion of set. Classical
membership of elements in a set are binary terms: an element either belongs or
@@ -77,17 +71,20 @@
interval [0, 1]. Classical sets, are special cases of the membership functions
of fuzzy sets, if the latter only take values 0 or 1. Classical sets are in
fuzzy set theory usually called crisp sets. The fuzzy set theory can be used in
-a wide range of domains in which information is imprecise, such as most of the
+a wide range of domains in which information is imprecise, such as most
GIS operations.
<h2>NOTES</H2>
+
<H4>Calculation of boundary shape</H4>
-Depending on type of the boundary different equation are used to determine its
+
+Depending on the boundary type, different equations are used to determine its
shape:
<P>
-<B>Linear:</B> the membership is calculated according following equation:<br>
+<B>Linear:</B> the membership is calculated according to the following equation:<br>
+
<pre><code>
value <= A -> x = 0
A< value > B -> x = (value-A)/(B-A)
@@ -98,10 +95,12 @@
where x: membership
</code></pre>
<P>
-<B>S-shaped:</B> it use following equation:
+
+<B>S-shaped:</B> uses the following equation:
+
<pre><code>
sin(x * Pi/2)^m (for positive shape parameter)
-1-cos(x * Pi/2)^m (for nagative shape parameter)
+1-cos(x * Pi/2)^m (for negative shape parameter)
where x: membership, and
m = 2^exp(2,shape) (for positive shape parameter)
@@ -109,11 +108,13 @@
where m: shape parameter.
</code></pre>
-For default shape parameter = 0 m is = 2 whcich is most common parameter for
+For the default shape parameter = 0, m is = 2 which is the most common parameter for
that equation.
<P>
-<B>G-shaped and J shaped:</B> it use following equations:
+
+<B>G-shaped and J shaped:</B> use the following equations:
+
<pre><code>
tan(x * Pi/4)^m (for J-shaped)
tan(x * Pi/4)^1/m (for G-shaped)
@@ -129,13 +130,13 @@
<em>
<a href="r.fuzzy.logic.html">r.fuzzy.logic</a>,
-<a href="r.mapcalc.html">r.mapcalc</a>,
+<a href="r.mapcalc.html">r.mapcalc</a>
</em>
<h2>REFERENCES</h2>
-Zadeh, L.A. (1965). "Fuzzy sets". Information and Control 8 (3): 338–353.
+Zadeh, L.A. (1965). "Fuzzy sets". Information and Control 8 (3): 338--353.
doi:10.1016/S0019-9958(65)90241-X. ISSN 0019-9958.<P>
Novák, Vilém (1989). Fuzzy Sets and Their Applications. Bristol: Adam Hilger.
@@ -154,8 +155,10 @@
Meyer D, Hornik K (2009b). sets: Sets, Generalized Sets, and Customizable Sets.
R~package version~1.0, URL http://CRAN.R-project.org/package=sets.<P>
+
<h2>AUTHOR</h2>
Jarek Jasiewicz
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date$</i>
Modified: grass-addons/raster/r.fuzzy/main.c
===================================================================
--- grass-addons/raster/r.fuzzy/main.c 2011-09-14 19:27:09 UTC (rev 48296)
+++ grass-addons/raster/r.fuzzy/main.c 2011-09-15 08:24:17 UTC (rev 48297)
@@ -1,16 +1,15 @@
-/* ***************************************************************************
+/* **************************************************************************
*
* MODULE: r.fuzzy
* AUTHOR(S): Jarek Jasiewicz <jarekj amu.edu.pl>
* PURPOSE: Calculate membership value of any raster map according user's rules
- * COPYRIGHT: (C) 1999-2010 by the GRASS Development Team
+ * COPYRIGHT: (C) 1999-2011 by the GRASS Development Team
*
* This program is free software under the GNU General Public
* License (>=v2). Read the file COPYING that comes with GRASS
* for details.
*
- ****************************************************************************
- */
+ ****************************************************************************/
#include <grass/gis.h>
#include <grass/glocale.h>
@@ -46,8 +45,7 @@
module = G_define_module();
module->keywords = _("raster, fuzzy logic");
- module->description =
- _("xxxx");
+ module->description = _("Cluster raster maps using fuzzy logic.");
par_input = G_define_standard_option(G_OPT_R_INPUT);
par_input->description = _("Raster map to be fuzzified");
@@ -85,7 +83,7 @@
par_shape = G_define_option();
par_shape->key = "shape";
par_shape->type = TYPE_DOUBLE;
- par_shape->options = "-1 to 1";
+ par_shape->options = "-1.0-1.0";
par_shape->answer = "0.";
par_shape->multiple = NO;
par_shape->required = YES;
@@ -95,7 +93,7 @@
par_height = G_define_option();
par_height->key = "height";
par_height->type = TYPE_DOUBLE;
- par_height->options = "0 to 1";
+ par_height->options = "0.0-1.0";
par_height->answer = "1";
par_height->multiple = NO;
par_height->required = YES;
More information about the grass-commit
mailing list