Ernest Friedman-Hill wrote: "if the function "insert-rules-and-templates-using-batch" were a deffunction, it would be undefined"

The insert-rules-and-templates-using-batch is a clp file containing templates, rules, queries, deffuctions (why not), everything that i need to have in my knowledge system. I inserted using the batch function (seems pretty clear this lines to me).

Ernest Friedman-Hill wrote: "Also, it seems odd that you're running the engine with run-until-halt before adding your facts on the next line; normally you'd want to do that in the other order."

Not in this case Ernest, my facts are not coming from the program but from external source, and the idea is as new data arrives (shadow facts), start to reason about it (it like a pooling process, when something arrives i dispatch it to the rule-based system). New facts are constantly arrived to the program, so i prefer to load everything before i start the process of subscribing the program input.

Unfortunately i cannot send you the code, but i can explain better.
-> when i use (clear) the rule based engine gets clean of every fact, rules, etc, which is ok; -> then i insert the templates and rules, using the batch call, and i can see that everything gets loaded in the system (again ok); ->the problem comes in the agenda, i was expecting when i do (run-until-halt) the system will start to reason about the facts (which are inserted parallel, but - i checked - are correctly inserted), but instead nothing happens. It seems that the (run-until-halt) as no effect. The agenda is empty, and no rule is active.

Other important note is that when i don't use clear, and just start the system from scratch (batch - reset - and run-until-halt), the rule-based system works perfectly. The problem arises when i put a clear in the beginning of the chain process.

My version of jess is 7.1p2, i was working with the 7.0 but i changed on hope to solve this problem. Still remains.

Regards,

Joao




On 18-08-2009 15:05, Ernest Friedman-Hill wrote:
Based just on this pseudocode, the two things I can say is that after the call to (clear), if the function "insert-rules-and-templates-using-batch" were a deffunction, it would be undefined; same for "start-thread-for-inserting-shadow-facts". Also, it seems odd that you're running the engine with run-until-halt before adding your facts on the next line; normally you'd want to do that in the other order. But as I said, since this isn't real code, it's hard to say what's wrong. "clear", in general, should return the Jess engine to its initial state, and everything should continue to work fine after that (except that everything previously defined is gone, of course.)



On Aug 18, 2009, at 3:41 AM, Joao Carlos Mourao wrote:

Hello,

I'm trying to implement a method to restart the rule engine by using the
clear command. The idea is before running, clear everything (using
clear), add all the facts available, and run the engine with the command
(run-until-halt). Although, every time i make use of clear command, the
rule engine blocks, and even if i insert new rules or facts, no rule
becomes active, its seems that is blocked. The procedure that i follow
is with two functions, start and stop, like following:

start:
   (clear)
   (insert-rules-and-templates-using-batch)
   (reset)
   (run-until-halt)
   (start-thread-for-inserting-shadow-facts)

stop:
   (halt)

Can anyone tell me what i'm doing wrong?

Thanks in advance,

Joao

------------------------
unclassified


---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, 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].
--------------------------------------------------------------------



------------------------------------------------------------------------------------------------------------
Disclaimer:

If you are not the intended recipient of this email, please notify the sender and delete it. Any unauthorized copying, disclosure or distribution of this email or its attachment(s) is forbidden. Thales Nederland BV will not accept liability for any damage caused by this email or its attachment(s). Thales Nederland BV is seated in Hengelo and is registered at the Chamber of Commerce under number 06061578.
------------------------------------------------------------------------------------------------------------

begin:vcard
fn;quoted-printable:Jo=C3=A3o Mour=C3=A3o
n;quoted-printable;quoted-printable:Mour=C3=A3o;Jo=C3=A3o
org:Thales;Above Water Systems
adr:;;;Hengelo;;;Netherlands
email;internet:[email protected]
title:THALES NETHERLANDS B.V.
tel;work:2640
note:-unclassified mail-
version:2.1
end:vcard

Reply via email to