Hello: I'm working my way through JIA while pondering a problem in my head. I'm considering using Jess for dynamically performing dependency resolution. I'm stumped on how to handle alternative. My sample facts:
f-0 (MAIN::dpelement (name "item0") (einc false) (iinc false) (size 34544)) <snip> f-2 (MAIN::dpelement (name "item1") (einc false) (iinc false) (size 48667)) f-3 (MAIN::dpelement (name "Aitem1") (einc false) (iinc false) (size 11207)) f-4 (MAIN::dp (a "item0") (type requires) (b "unit1")) f-5 (MAIN::dp (a "item1") (type provides) (b "unit1")) f-6 (MAIN::dp (a "Aitem1") (type provides) (b "unit1")) Each dpelement can either be explicitly or implicitly included (the einc and iinc slots) and has a size. The dp facts define the dependency tree. If item0 is explicitly included then -either- item1 or Aitem1 could satisfy. item1 and Aitem1 could, of course, have dependencies of their own which must be evaluated. One of the two should be selected based on the smaller cumulative size of the dpelement and all of its dependencies. 1) How do I select amongst the two or more dpelements that satisfy the dependency on the basis of the size slot? [I suspect this is a job for a custom conflict resolver since the dependency resolving rule activates multiple times.] 2) How can I recurse into dependent elements to sum up their size? [backwards chaining... seems much like the factorial example in JIA.] Or maybe I've structured this wrong. I've got lots of facts and a few rules. I've got a few rules that study the dp elements to make dependency decisions. Maybe I should have less facts and more rules where each dependency is encoded as a rule? Thank you for your advice, Brad -------------------------------------------------------------------- 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] --------------------------------------------------------------------
