I think Xavier Noria wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] > On Thursday 03 April 2003 17:57, [EMAIL PROTECTED] wrote: > > > Yes, and there's no problem there: you can add and remove rules from > > a running Jess engine; i.e. the rule engine can "learn" as it runs. > > Excellent. > > How would you implement the usage of different sets of rules for > different instances?
You'd want to have a separate instance of the engine (the jess.Rete class) for each rule set. Alternatively, you could have a separate one for each agent, but with 400 agents in one process, that's probably too heavyweight a solution. > > Let's suppose you have 200 agents of type A and 200 of type B. Each > group have a different set of rules. Then, in each tick of time each > agent is asked to act somehow. Objects of type A should fire their > rules, and objects of type B their own. (I suppose from your feedback > that it would be natural to have a singleton with a Rete object created > when the simulation is launched.) > > Would you assert and retract rules as needed, fetch and store a variable > to represent the agent, and program Jess code as if there was just one > agent in scope, so 400 Jess runs would be performed? > The trick to keeping the various agents "trains of thought" separate even though they're sharing an engine is for agent-specific facts to have an agent-specific tag; i.e., you can't use facts like (agent-network-port 6543) Instead they would use something like (agent-network-port (id 123) (port 6543)) Where 123 is a unique identifier for a single agent; that way there could be separate agent-network-port facts for each agent. This way, there can be just -one- run, and all 200 agents sharing an engine can "think" at the same time! --------------------------------------------------------- Ernest Friedman-Hill Distributed Systems 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] --------------------------------------------------------------------
