On Feb 7, 2007, at 7:30 PM, #NG BOON KIAT# wrote:

I'm currently working on a distributed multi-agent simulation system that uses JESS for behaviour inference. The behaviours are stored inside a Protege ontology. For each cycle of the simulation, each agent has to update the ontology, followed by getting the new behaviour from the ontology.

Ideally, each computer (node) in the system will control a number of agents as well as have 1 JESS engine. However, during testing of the framework, I had to simulate the running of 2 nodes on my computer. This means having more than 1 JESS engine running at the same time. The first engine works fine, but when the second engine tried to make a ontology update, I get errors such as unable to read/write.

Is there really no way to have more than 1 JESS engine running at the same time?


Of course there is -- you can create as many instance of the jess.Rete class as you like, and run them all independently. It says so in the manual, doesn't it? There's even a simple inter-engine communication mechanism built into Jess (the function "call-on-engine".)

Here's a tiny program in the Jess language that uses two engines. A rule is defined in the first engine which, when fired, prints a message, then defines a rule in a second engine, resets it, and runs it. When you run this program, first the rule fires in the first engine, and this causes the rule to fire in the second engine, so you'll see both messages printed once.

(set-reset-globals FALSE)
(defglobal ?*e2* = (new jess.Rete))
(defrule hello-1
  =>
  (printout t Hello1 crlf)
(call-on-engine ?*e2* (eval "(defrule hello-1 => (printout t Hello2 crlf))"))
  (call-on-engine ?*e2* (reset))
  (call-on-engine ?*e2* (run)))
(reset)
(run)

Whenever you're reporting a problem like this, on the Jess list or anywhere else, it helps to be much more specific about what *exactly* you tried, and what *exactly* happened, including the *exact* text of any messages you receive. I don't know what you tried, but "unable to read/write" doesn't sound like any message that Jess can produce.


---------------------------------------------------------
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://www.jessrules.com

--------------------------------------------------------------------
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]
--------------------------------------------------------------------

Reply via email to