[GRASS-user] Compiling addons from svn repository
gianluca massei
g_massa at libero.it
Mon Aug 4 08:52:04 EDT 2008
Thanks Moritz , great tip!
I'm working in a module that implemented ELECTRE algorithm.
I've just finisced a module named /r.roughset/ for knowledg discovery
with rough set based on rough set library. You can download the source
code from grass wiki
(http://grass.osgeo.org/wiki/GRASS_AddOns#r.roughset) and I'm happy if
sameone caould try it and report me tips or bugs.
Gianluca
Moritz Lennert ha scritto:
> On 04/08/08 13:39, gianluca massei wrote:
>> Hy list,
>> I'm writing a C module for multiciriteria decision analysis in GRASS.
>
> Great news ! I'm very interested in this.
>
> If you haven't already, you might want to have a look at the old
> r.infer and r.weight modules in grass5.4. Also see the GRASS news
> article by Peter Löwe: http://grass.itc.it/newsletter/grassnews3.html.
>
> Just one suggestion: it might be worthwhile thinking about error
> handling/propagation in such a module...
>
>> I've a problem with doublevalue multiple answers processing.
>> The code is like that:
>> "
>> / weight = G_define_option();
>> weight->key = "weight";
>> weight->type = TYPE_DOUBLE;
>> weight->required = YES;
>> weight->multiple = YES; weight->description = _("Criteria
>> weight(s) (w1,w2,..)");/
>> "
>>
>> I'd like extract single value so, I tried this:
>> "
>> / for(i=0;i<ncriteria;i++)
>> {
>> G_message(_("Peso %d : %lf"),i,weight->answers[i]);
>> }/
>> "
>
> Not sure, but I think the ->answers are always string, so you have to
> transform to float with atof:
>
> G_message(_("Peso %d : %lf"),i,atof(weight->answers[i]));
>
> Moritz
>
> Database dei virus interno non c aggiornato.
> Controllato da AVG - http://www.avg.com Versione: 8.0.138 / Database
> dei virus: 270.5.10/1584 - Data di rilascio: 31/07/2008 12.00
>
>
>
More information about the grass-user
mailing list