[GRASS-SVN] r65820 - grass-addons/grass7/raster/r.mcda.electre

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 3 10:44:00 PDT 2015


Author: gianluca
Date: 2015-08-03 10:44:00 -0700 (Mon, 03 Aug 2015)
New Revision: 65820

Modified:
   grass-addons/grass7/raster/r.mcda.electre/Makefile
   grass-addons/grass7/raster/r.mcda.electre/dominance.c
   grass-addons/grass7/raster/r.mcda.electre/main.c
Log:
fix bugs in discordance index map

Modified: grass-addons/grass7/raster/r.mcda.electre/Makefile
===================================================================
--- grass-addons/grass7/raster/r.mcda.electre/Makefile	2015-08-03 16:42:42 UTC (rev 65819)
+++ grass-addons/grass7/raster/r.mcda.electre/Makefile	2015-08-03 17:44:00 UTC (rev 65820)
@@ -1,4 +1,4 @@
-MODULE_TOPDIR = ../../..
+MODULE_TOPDIR = ../..
 PGM = r.mcda.electre
 
 LIBES = $(RASTERLIB) $(GISLIB) $(MATHLIB)

Modified: grass-addons/grass7/raster/r.mcda.electre/dominance.c
===================================================================
--- grass-addons/grass7/raster/r.mcda.electre/dominance.c	2015-08-03 16:42:42 UTC (rev 65819)
+++ grass-addons/grass7/raster/r.mcda.electre/dominance.c	2015-08-03 17:44:00 UTC (rev 65820)
@@ -73,15 +73,16 @@
             {
                 for (col2 = 0; col2 < ncols; col2++)
                 {
-                    double conc = 0, disc = 0;
+                    double conc = 0, disc = -100;
                     for (i = 0; i < ncriteria; i++)
                     {
                         double d;
 						d = decision_vol[row1][col1][i] - decision_vol[row2][col2][i];
                         if (d >= 0 )
                             conc += weight_vect[i];
-                        if (d > disc)	/*WARNING: if(d>conc) */
+                        if (d >= disc)	/*WARNING: if(d>conc) */
                             disc = d;
+						//printf("\ndisc:%f-:%f -:%f",disc,decision_vol[row1][col1][i], decision_vol[row2][col2][i]);
                     }
                     row_sum_conc[k] += conc;
                     col_sum_conc[j] += conc;
@@ -109,7 +110,7 @@
                 row_sum_conc[cont] - col_sum_conc[cont];
             /*fill matrix with discordance index for each DCELL */
             decision_vol[row1][col1][ncriteria + 1] =
-                row_sum_disc[cont] - col_sum_disc[cont];
+                col_sum_disc[cont]-row_sum_disc[cont];
             cont++;
         }
     }

Modified: grass-addons/grass7/raster/r.mcda.electre/main.c
===================================================================
--- grass-addons/grass7/raster/r.mcda.electre/main.c	2015-08-03 16:42:42 UTC (rev 65819)
+++ grass-addons/grass7/raster/r.mcda.electre/main.c	2015-08-03 17:44:00 UTC (rev 65820)
@@ -71,7 +71,7 @@
     weight->type       = TYPE_DOUBLE;
     weight->required   = YES;
     weight->multiple   = YES;
-    weight->description = _("Criteria weight(s) (w1,w2,..wn)");
+    weight->description = _("Criteria weight(s) (w1,w2,..,wn)");
 
     concordance = G_define_option(); /* Allocates memory for the Option structure and returns a pointer to this memory */
     concordance->key = "concordance";



More information about the grass-commit mailing list