[GRASS-SVN] r34903 - grass-addons/raster/mcda/r.roughset

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Dec 15 18:09:20 EST 2008


Author: gianluca
Date: 2008-12-15 18:09:20 -0500 (Mon, 15 Dec 2008)
New Revision: 34903

Added:
   grass-addons/raster/mcda/r.roughset/description.html
Modified:
   grass-addons/raster/mcda/r.roughset/raccess.c
   grass-addons/raster/mcda/r.roughset/rclass.c
   grass-addons/raster/mcda/r.roughset/rsystem.c
Log:
r.roughset: more options (rules from txt) and better interface

Added: grass-addons/raster/mcda/r.roughset/description.html
===================================================================
--- grass-addons/raster/mcda/r.roughset/description.html	                        (rev 0)
+++ grass-addons/raster/mcda/r.roughset/description.html	2008-12-15 23:09:20 UTC (rev 34903)
@@ -0,0 +1,143 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML>
+<HEAD>
+	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
+	<TITLE>r.roughset</TITLE>
+	<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.4  (Linux)">
+	<META NAME="CREATED" CONTENT="0;0">
+	<META NAME="CHANGEDBY" CONTENT="root">
+	<META NAME="CHANGED" CONTENT="20081213;19151100">
+	<META NAME="CHANGEDBY" CONTENT="root">
+	<META NAME="CHANGEDBY" CONTENT="root">
+	<STYLE TYPE="text/css">
+	<!--
+		@page { size: 21cm 29.7cm }
+		H2.western { font-family: "Albany", sans-serif; font-size: 14pt; font-style: italic }
+		H2.cjk { font-family: "HG Mincho Light J"; font-size: 14pt; font-style: italic }
+		H2.ctl { font-family: "Arial Unicode MS"; font-size: 14pt; font-style: italic }
+	-->
+	</STYLE>
+</HEAD>
+<BODY LANG="it-IT" DIR="LTR">
+<H2 CLASS="western" ALIGN=JUSTIFY>r.roughset</H2>
+<P ALIGN=JUSTIFY><B>r.roughset&nbsp;</B>è un modulo che
+consente&nbsp;l'applicazione della rough set theory [1,2] a database
+geografici in ambiente GRASS GIS. L'input è costituito da due gruppi
+di dati: <BR>1. gli attributi geografici che costituiscono il sistema
+informativo della rough set analisys e che si ritiene siano
+sufficienti a descrivere&nbsp;un determinato fenomeno naturale,
+sociale od economico (<B>attributes</B>=<EM>string[,string,...]</EM>);<BR>2.
+il tematismo nel quale sono identificate le aree per cui il fenomeno
+da studaire si è presentato con una certa modalità
+(<B>decision</B>=<EM>string</EM>). Il valore non nullo di ogni cella
+di questo raster va a riempire l'ultima colonna del sistema
+informativo mentre le corrispondenti celle dei raster nel campo
+<B>attributes </B><SPAN STYLE="font-weight: medium">completano le
+altre colonne. </SPAN>
+</P>
+<P ALIGN=JUSTIFY STYLE="margin-bottom: 0cm">Il sistema informativo
+così generato viene trattato con le funzioni esposte dalla versione
+2 delle rough set library (RSL, ver. 2.0)&nbsp; [3] secondo una delle
+strategie decisionali disponibili con l'opzione <B>strgy</B>=<EM>string.</EM></P>
+<P ALIGN=JUSTIFY STYLE="margin-bottom: 0cm"><EM><SPAN STYLE="font-style: normal">La
+scelta della strategia di classificazione, </SPAN></EM><EM><SPAN STYLE="font-style: normal"><B>clssfy</B></SPAN></EM><EM>=string
+</EM><EM><SPAN STYLE="font-style: normal">è indispensabile per
+generare una mappa sulla base dei criteri descritti con gli attributi
+(attributes) e le regole decisionali generate. Le opzioni sono 3:
+</SPAN></EM><EM><I>Classify1,Classify2,Classify3</I></EM><EM> </EM><EM><SPAN STYLE="font-style: normal">e
+ognuna corrisponde a tre differenti algoritmi [3]. </SPAN></EM><BR><BR>L'output
+è costituito da tre differenti files di cui due di tipo testo<EM> </EM>ed
+uno raster:</P>
+<P ALIGN=JUSTIFY>a. <I>file testo</I> strutturato secondo lo standard
+suggerito dalla rough set library, contraddistinto dallo stesso nome
+indicato nel campo <B>outTXT</B><I><SPAN STYLE="font-weight: medium">=string</SPAN></I>
+senza ulteriori suffissi; è necessario nel caso in cui le regole
+decisionali generate per un contesto geografico debbao essere
+applicate in un'altra location, sulla base di raster di attributi e
+decisionali con lo stesso significato e lo stesso range di valori. In
+questo caso il campo sample=string dovrà contenere il nome completo
+di un file outTXT precedentemente generato e il campo <EM><SPAN STYLE="font-style: normal"><B>decision=</B></SPAN></EM><EM><I><SPAN STYLE="font-weight: medium">string</SPAN></I></EM><EM>
+</EM><EM><SPAN STYLE="font-style: normal"><SPAN STYLE="font-weight: medium">può
+essere tralasciato</SPAN></SPAN></EM> Il file può anche essere
+utilizzato con implementazioni delle le RSL al di fuori dall'ambiente
+GIS;</P>
+<P STYLE="margin-bottom: 0cm"><I>NAME: nome del sistema informativo</I></P>
+<P STYLE="margin-bottom: 0cm"><I>ATTRIBUTES: 4 (numero degli
+attributi)</I></P>
+<P STYLE="margin-bottom: 0cm"><I>OBJECTS: 8 (numero degli oggetti)</I></P>
+<P STYLE="margin-bottom: 0cm"><I>0 0 0 0 </I>
+</P>
+<P STYLE="margin-bottom: 0cm"><I>1 0 1 1</I></P>
+<P STYLE="margin-bottom: 0cm"><I>1 1 0 0 </I>
+</P>
+<P STYLE="margin-bottom: 0cm"><I>0 2 0 1 </I>
+</P>
+<P STYLE="margin-bottom: 0cm"><I>1 2 0 1 </I>
+</P>
+<P STYLE="margin-bottom: 0cm"><I>1 0 0 0 </I>
+</P>
+<P STYLE="margin-bottom: 0cm"><I>1 2 0 1 </I>
+</P>
+<P STYLE="margin-bottom: 0cm"><I>0 0 1 1 </I>
+</P>
+<P><I>Box 1</I></P>
+<P ALIGN=JUSTIFY><BR><BR>
+</P>
+<P ALIGN=JUSTIFY>Il numero degli attributi è pari a quello dei
+raster dati come input al parametro <B>attributes</B>=<EM>string[,string,...]
+</EM><EM><SPAN STYLE="font-style: normal">più il raster decisionale
+</SPAN></EM><EM>(</EM><EM><SPAN STYLE="font-style: normal"><B>decision</B></SPAN></EM><EM>=string)
+</EM><EM><SPAN STYLE="font-style: normal">che per convenzione occupa
+l'ultima colonna del sistema informativo.</SPAN></EM></P>
+<P ALIGN=JUSTIFY>b. <I>file testo</I>, contraddistinto dal prefisso
+definito in <B>outTXT</B><I><SPAN STYLE="font-weight: medium">=string</SPAN></I>
+e dal suffisso .<I>out</I>, contenente le regole decisionali estratte
+dal sistema informativo geografico, oltre che il core e&nbsp;&nbsp;i
+ridotti; le regole decisionali sono nella forma: &nbsp;<I>if ... then
+</I>e sono facilmente leggibili ed interpretabili dall'analista per
+finalità descritive del fenomeno oggetto di studio;<BR>c. <I>raster,
+</I><SPAN STYLE="font-style: normal">contraddistinto dal nome
+indicato nel campo</SPAN> <SPAN STYLE="font-style: normal"><B>outMAP</B></SPAN><I>=string,
+</I><SPAN STYLE="font-style: normal">ottenuto dall'applicazione delle
+regole decisionali generate dal sistema informativo geografico
+secondo una delle strategie di classificazione in </SPAN><EM><SPAN STYLE="font-style: normal"><B>clssfy</B></SPAN></EM><EM>=string.
+</EM><EM><SPAN STYLE="font-style: normal">Le regole da applicare
+possono derivare da un sistema informativo generato dai valori
+inseriti in </SPAN></EM><EM><SPAN STYLE="font-style: normal"><B>attributes</B></SPAN></EM><EM><SPAN STYLE="font-style: normal">=</SPAN></EM><EM>string
+</EM><EM><SPAN STYLE="font-style: normal">e</SPAN></EM><EM>
+</EM><EM><SPAN STYLE="font-style: normal"><B>decision</B></SPAN></EM><EM>=string
+</EM><EM><SPAN STYLE="font-style: normal">oppure da un file testuale
+generato da un precedente elaborazione. In questo caso la struttura
+del file deve essere rigidamente quella indicata in box 1.</SPAN></EM></P>
+<H2 CLASS="western" ALIGN=JUSTIFY>NOTES</H2>
+<P ALIGN=JUSTIFY>Il modulo è in grado di trattare raster di
+qualsiasi tipo (CELL,FCELL,DCELL) ma le elaborazioni vengono eseguite
+tutte su variabili di tipo intero (int) perchè questo è imposto
+dalle rough set library. Le regole decisionali, conseguentemente,
+restituiscono informazioni esclusivamente di tipo intero.</P>
+<H2 CLASS="western" ALIGN=JUSTIFY>REFERENCE</H2>
+<OL>
+	<LI><P ALIGN=JUSTIFY>Pawlak Z. Rough Sets, International Journal of
+	Information&nbsp;and Computer Science Vol. 11, No. 5, 1982, pp.
+	344-356.</P>
+	<LI><P ALIGN=JUSTIFY>Pawlak Z. Rough Sets, Theoretical Aspects of
+	Reasoning&nbsp;about Data, Kluwer Academic Publishers, 1991.</P>
+	<LI><P ALIGN=JUSTIFY>Gawrys M.,&nbsp;Sienkiewicz J. Rough Set
+	Library - User's manual&nbsp;(ver. 2.0), September 1993</P>
+	<LI><P ALIGN=JUSTIFY><A HREF="http://en.wikipedia.org/wiki/Rough_set">http://en.wikipedia.org/wiki/Rough_set</A>
+	- “rough set”</P>
+	<P ALIGN=JUSTIFY><BR><BR><BR>
+	</P>
+</OL>
+<H2 CLASS="western" ALIGN=JUSTIFY>SEE ALSO</H2>
+<P ALIGN=JUSTIFY><EM>r.mcda.fuzzy, r.mcda.electre, r.mcda.regime</EM></P>
+<H2 CLASS="western" ALIGN=JUSTIFY>AUTHORS</H2>
+<P ALIGN=JUSTIFY>Antonio Boggia - Gianluca Massei&nbsp;<BR>Dipartimento
+di Scienze Economico Estimative e degli Alimenti - Università di
+Perugia - Italy</P>
+<P ALIGN=JUSTIFY><BR><BR>
+</P>
+<P><BR><BR>
+</P>
+</BODY>
+</HTML>
\ No newline at end of file

Modified: grass-addons/raster/mcda/r.roughset/raccess.c
===================================================================
--- grass-addons/raster/mcda/r.roughset/raccess.c	2008-12-15 18:14:28 UTC (rev 34902)
+++ grass-addons/raster/mcda/r.roughset/raccess.c	2008-12-15 23:09:20 UTC (rev 34903)
@@ -2,9 +2,9 @@
  *
  * MODULE:       r.roughset
  * AUTHOR(S):    GRASS module authors ad Rough Set Library (RSL) maintain:
- *					G.Massei (g_massa at libero.it)-A.Boggia (boggia at unipg.it)		
- *				 Rough Set Library (RSL) ver. 2 original develop:
- *		         	M.Gawrys - J.Sienkiewicz 
+ *			G.Massei (g_massa at libero.it)-A.Boggia (boggia at unipg.it)		
+ *			Rough Set Library (RSL) ver. 2 original develop:
+ *		        M.Gawrys - J.Sienkiewicz 
  *
  * PURPOSE:      Geographics rough set analisys and knowledge discovery 
  *

Modified: grass-addons/raster/mcda/r.roughset/rclass.c
===================================================================
--- grass-addons/raster/mcda/r.roughset/rclass.c	2008-12-15 18:14:28 UTC (rev 34902)
+++ grass-addons/raster/mcda/r.roughset/rclass.c	2008-12-15 23:09:20 UTC (rev 34903)
@@ -91,9 +91,9 @@
        size=_mainsys->attributes_num;
    for (j=0;j<size;j++)
    {  if ( !ContSetA(P,j) ) continue;
-      if ( rule[j] != sample[j] )
-	 if ( rule[j]!=MINUS && sample[j]!=MINUS )
-	    result++;
+      	if ( rule[j] != sample[j] )
+	 		if ( rule[j]!=MINUS && sample[j]!=MINUS )
+	    		result++;
    }
    return result;
 } 

Modified: grass-addons/raster/mcda/r.roughset/rsystem.c
===================================================================
--- grass-addons/raster/mcda/r.roughset/rsystem.c	2008-12-15 18:14:28 UTC (rev 34902)
+++ grass-addons/raster/mcda/r.roughset/rsystem.c	2008-12-15 23:09:20 UTC (rev 34903)
@@ -133,7 +133,7 @@
  { sys->matA=buf; }
 
 void PutA(SYSTEM *sys,int obj,int atr,value_type val)
- { (sys->matA)[obj*(sys->attributes_num)+atr]=val; }
+ {(sys->matA)[obj*(sys->attributes_num)+atr]=val; }
 
 int FillAfromAscii(SYSTEM *sys,FILE *file)
  {



More information about the grass-commit mailing list