Similar to Ernest's suggestion ... instead of creating separate Rete objects you could create multiple rule sets within a single Rete object. Let's assume that each visitor is given a unique sequential integer id as they arrive at the museum ... first one gets id 1, second 2, etc. your could duplicate your A, B and C rules as A0, B0, C0, Z0 and A1, B1, C1, Z1 ... and An, Bn ,Cn, Zn. Each of these rules has a pattern that matches on the visitor id modulo n+1 and compares it 0 for the A0, B0, C0, Z0 rules or to n for the An, Bn, Cn, Zn rules.
You also assign saliences to these rules something like: A0, B0, C0 salience 101 and Z0 salience 100 A1, B1, C1 salience 201 and Z1 salience 200 A2, B2, C2 salience 301 and Z2 salience 300 etc. So if n is 5 we could have: (defrule A0 (declare (salience 101)) (visitor ?id&:(= 0 (mod ?id 6))) ... ) ... (defrule Z0 (declare (salience 100)) (visitor ?id&:(= 0 (mod ?id 6))) ... ) ... (defrule A5 (declare (salience 601)) (visitor ?id&:(= 5 (mod ?id 6))) ... ) ... (defrule Z5 (declare (salience 600)) (visitor ?id&:(= 5 (mod ?id 6))) ... ) Now of course this will be problematic if A, B and C turn out to be not 3 rules but 100 rules. There must be better solutions but off the top of my head this might be a possibility. Bob Orchard National Research Council Canada Conseil national de recherches Canada Institute for Information Technology Institut de technologie de l'information 1200 Montreal Road, Building M-50 M50, 1200 chemin Montrial Ottawa, ON, Canada K1A 0R6 Ottawa (Ontario) Canada K1A 0R6 (613) 993-8557 (613) 952-0215 Fax / tilicopieur [EMAIL PROTECTED] Government of Canada | Gouvernement du Canada -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of [EMAIL PROTECTED] Sent: Wednesday, March 10, 2004 5:34 PM To: [EMAIL PROTECTED] Subject: Re: JESS: problem with saliences in a multiple-user system This is perhaps not a solution for us. For now, we load 8.39 MB facts that come from DAML ontlogies (we will have more later). These facts are shared between all visitors thus your solution will be very memory intensive. Can you think of any other way? Thanks. On Wed, 10 Mar 2004 13:22:19 -0800 (PST) [EMAIL PROTECTED] wrote: > > > Ah, OK, I see what you're saying. It's not a performance problem, > really; it's a response-time problem. The various visitors interfere > with each other. > > Well, one thing you could do, of course, would be to use a pool of > Rete objects instead of a single one. One per visitor, or one per some > small number of visitors. This would let you use essentially the same > rule design but without the delays. > > > > > > I think [EMAIL PROTECTED] wrote: > > > > We are building a system to deliver audio objects to museum visitors. > > Imagine more than one visitor sends request to the system. Different > rules > have different saliences. Let rules A, B, C that assign rates to > audio > objects have a higher salience than rule Z that sums these rates > for every > audio object. Imagine for visitor x rules A, B and C fired. But > it should > wait for rules A, B, and C to finish work for visitor y as > well, before > summation (rule Z) can happen for visitor x. Therfore, when > there are more > than one visitor in the museum and they make a request at > the same time, all > computations wait for each other to finish before > audio delivery to a > visitor takes place. Therefore the delivery happens > at the same time for > all visitors and this is a burden to performance. > > > > > > On Tue, 9 Mar 2004 05:03:18 -0800 (PST) [EMAIL PROTECTED] wrote: > > > I think Jordan Willms wrote: > > > > Hello, > > > > > > > > I am looking at Fuzzy HVAC Controller example in the Jess book. At > the > > > bottom of page 275, it says that "because the rule must wait > until all > > the > other fuzzy rules have fired, to allow Jess to combine > the outputs, > > it is > set at a lower priority (salience) than others". > How if the > program > > > was > supposed to control more than one device? Then one device had to > > wait > > > for > the result of all others to finish first. We are having a similar > > > problem > and it decreases the performance of our system significantly. > > > Does anyone > has a solution? > > > > > > > > > I'm not quite sure what you're asking, because the fuzzy control > > > program *does* control more than one device; I've run it with a > > > 99-story building (33 heat pumps). I'm also not sure if you understand > > > what "wait" means in this context; it just means that out of the many > > > simultaneously activated rules, one particular rule can't be allowed > > > to fire until certain others have fired; salience is used to make sure > > > the rules fire in the correct order. But there's no "waiting" in the > > > sense of standing around doing nothing, and there's no performance > > > impact. > > > > > > In any case, can you be more specific about the problem you're having? > > > > > > > > > --------------------------------------------------------- > > > Ernest Friedman-Hill > > > Science and Engineering PSEs 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] > > > > -------------------------------------------------------------------- > > > > -------------------------------------------------------------------- > > 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] > > -------------------------------------------------------------------- > > > > > --------------------------------------------------------- > Ernest Friedman-Hill > Science and Engineering PSEs 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] > -------------------------------------------------------------------- -------------------------------------------------------------------- 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] -------------------------------------------------------------------- -------------------------------------------------------------------- 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] --------------------------------------------------------------------
