I think Joseph Grant wrote: > > Please, would somebody explain this to me: there are quite a few rules > defined in the "Interview" section, some with no "LHS". According to the > book, "these rules have no patterns and are activated by a call to reset". > I'm cool with that. My question is, how does Jess know the order in which > these rules get loaded into the Agenda?
The order of rules on the agenda is explicitly determined by the "conflict resolution strategy" (see page 121.) If a group of rules are all activated at the same time, by the same facts, with the same salience, many conflict resolution strategies -- including the two built-in ones -- won't differentiate between them. Therefore, the rules will fire in an arbitrary (*not* random, just not defined) order determined by the implementation. Basically, the order falls out of the way the Rete network is laid out for a set of rules. If you change the order in which the rules are defined in the source file, you'll change the order in which these rules fire. This is not to say that they'll fire in definition order -- just that the arbitrary order is sensitive to the order in which they were defined. > I have tried the example many times over, even compared to the output in the > book (pages 183 and 184) and the questions are always asked in the same > order. The first question is the one for the annual income, the next is for > the 'home office'. The 'home office' rule was the last one defined in the > Interview section. So, how does Jess know to ask for 'request-income' > first, then 'request-home-office' followed by 'charity' and so on? I > realize there are other questions that are qualified by how much income one > has. I am just trying to understand how the non-LHS rules get queued up. > The answer is that the "request-income", "request-moving", "request-charity", "request-home-office" rules can and do fire in this arbitrary-but-not-random order. The fact that request-income fires first is just a happy coincidence, because it's aesthetically pleasing. But it's *not* necessary. By design, if someone moved, or has a home office, we want to give them the forms, regardless of income. There are other request- rules that show how to defer asking a question until some other question is asked; you could use this same pattern to force income to be requested first, if you wanted. --------------------------------------------------------- Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://herzberg.ca.sandia.gov -------------------------------------------------------------------- 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] --------------------------------------------------------------------