Re: fuzzy logic
Tomas Mecir <mecirt <at> gmail.com>
2007-02-03 13:37:37 GMT
2007/2/2, Thomas Zander <zander <at> kde.org>:
> Anyone up for trying to see if this thing can be adapted for KSpread?
Just had a look. It seems to be a combination of Java classes and
OOBasic macros, so the only way of adapting that would be a rewrite
using their ideas and algorithms.
The whole thing, from how I've seen it, is a rather ugly hack though -
OO.org apparently has no way of defining new datatypes for formulas
(we don't have any either, although I'm hoping to change that), so
this thing seems to be working by installing some sort of OOBasic
handler that gets executed whenever a cell changes, and it looks into
the cell formula if it contains a call to some meta-formulas such as
FUZZYFORMULA() - if so, it passes the text to the java module, which
parses everything within and returns some approximation of the fuzzy
number, while keeping the real value in some internal storage or
If we want something like this to be possible as a KSpread plug-in,
this likely wouldn't be the best way to go - allowing custom datatypes
would be much more flexible. It's one of the things that I have on my
"when I have time" list.
Currently, we have classes like ValueConverter or ValueFormatter,
which do their job perfectly, but aren't extensible for new datatypes.