Hi,
I'm pretty new to this rule-based programming stuff and trying to come up to
speed on some of the more basic concepts. Currently, I'm trying to use JESS
to enforce a set of constraints on a data structure (a tree). Here's the
basic problem:
I have a tree with nodes that can be in one of three states, say UNKNOWN,
GOOD, and BAD. Initially, all the nodes in the tree are in the UNKNOWN
state. As information enters the system node states are updated to reflect
current conditions by rules acting on the individual nodes.
The tree has an associated set of constraints that I am also trying to model
with rules.
1. If any parent node is GOOD, then all the children are GOOD
2. If any child node is BAD, then the child's parent is also BAD
3. If all the children of a parent are GOOD, then the parent is also GOOD.
Now, I've been able to make all this stuff work, except for that last
constraint. Obviously, I could write a rule that simply lists a condition
for each child that updates the parent state when all the children are in
the GOOD state, however this seems awkward to me and doesn't seem to
leverage the chaining mechanism inherent in the rules. I've thought about
other approaches, but everything I've come up with seems either like I am
forcing things or just plain won't do what I expect.
So, I thought I'd write and see if anyone out there could point me in the
right direction as to how to write solid rules for this sort of thing, or
perhaps give me a pointer to a resource that might explain how to do this
sort of thing in a sound way. Thanks in advance for any assistance.
-- DanP
=============
Dan Peters
Sr. Software Engineer, TMGT
Location: CH10 - D3 (AZ)
Office Ph: 1-(480)-554-7123
Email: <mailto:[EMAIL PROTECTED]>
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------