[GRASS-user] Fwd: r.fuzzy.sytem rule file syntax error

Johannes Radinger johannesradinger at gmail.com
Tue May 7 04:36:06 PDT 2013


Hi again,

following my last email I tried to simplify the rule and still get an
error. It seems that
there are problems with parsing the rules. Here are two very simple rules
that both (should) mean
the same thing:

$ low {(depth=verylow & velocity=verylow) | (depth=low & velocity=verylow)
| (depth=verylow & velocity=low) | (depth=verylow & velocity=medium) |
(depth=veryhigh & velocity=medium) | (depth=high & velocity=high)}

$ low {(depth=verylow & velocity=verylow) | ((depth=low & velocity=verylow)
| ((depth=verylow & velocity=low) | ((depth=verylow & velocity=medium) |
((depth=veryhigh & velocity=medium) | (depth=high & velocity=high))))}

But for both I get an error when they're checked by r.fuzzy.system.
What I don't know is how to use the or-operator '|' correctly multiple
times. E.g. for "either A or B or C".
How do I need to set the parentheses correctly so that the rules are parsed
correctly. As I don't understand
the code in
https://svn.osgeo.org/grass/grass-addons/grass6/raster/r.fuzzy.system/rule_parser.c
I am not sure what is happening there. If it is just an error that is not
influencing the fuzzy output, can
that be somehow bypassed as I thought the rules are correct.

Hopefully anybody can help here!

Best regards,
Johannes



---------- Forwarded message ----------
From: Johannes Radinger <johannesradinger at gmail.com>
Date: Tue, May 7, 2013 at 11:35 AM
Subject: r.fuzzy.sytem rule file syntax error
To: GRASS user list <grass-user at lists.osgeo.org>


Hi,
I try to use the r.fuzzy.system tool but my rules do not work. The error
seems to be related
with a line in the rule definition file. The line is:

$ low {(depth=veryhigh & (velocity=medium | velocity=high)) | ((depth=high
& (velocity=high | velocity=veryhigh)) | ((depth=medium &
velocity=veryhigh) | (depth=low & velocity=verylow)))}

ERROR: line 2 Syntax error near < )>

However that does not give me the real info about the problem. I checked
several times the number of opening and closing braces")" but somehow I
can't find the syntax error. Probably I am just code-blind :)

Any suggestions? Is there any possibility to check the syntax resp. to pin
down where excaclty the problem is?

/johannes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130507/be292832/attachment.html>


More information about the grass-user mailing list