I'm converting a pre-existing pseudo-rulebase for use within JESS.
I use the term pseudo, because the rules have an implicit ordering
to them. Basically, they used to process the rules by checking each
one in order, and the first one to fire is the answer. It is a
categorization
rulebase, where a multi-digit code is being categorized as a type
of container. And the rules start with the most-specific type of
container it could be, and end with the most-generic type.
A much simplified example:
Code = R2B
Rule1
if (codeChar1 = R)
then container = air-transportable-tonnage
Rule2
if (codeChar3 = B)
then container = generic-container
The problem I am facing is that the creators/users of the rules cannot
completely specify every possible combination of codes. They use
the implicit ordering to have a fall-through so that they can have
some sort of classification in case they didn't specify a combination.
In the above example, they are interested in catching
air-transportable-tonnage
specifically, but all other **B codes can just be plain containers.
When I
translate the above rules into JESS, of course I get both rules to fire,
when what I really want is the results from Rule1. I've tried putting
in Rule2 (if codeChar1 ~=R), but there are other rules where I would
have to say & notX & notY, etc. And so if I added another specific
rule, I would also have to add the not condition to Rule2. This seems
too high maintenance.
How would I go about coding the JESS rulebase in order to catch only
the most specific categorization? Using salience still fires them all
in
a specific order, but how do I pair the list down to a single return
value?
Any hints would be appreciated.
KathyLee Simunich
Argonne National Lab
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------