I think Ashish Majmundar wrote:
> Hi,
>
>
> Rete rete = new Rete();
> Context c = rete.getGlobalContext();
> rete.executeCommand("(reset)");
...
> rete.reset();
These last two calls have -exactly- the same effect, but the first one
is inefficient.
> rete.executeCommand("(batch test.clp)");
...
> rete.executeCommand("(assert (run-until-halt))");
This is the problem.
1) Here you've confused executing a function with asserting a
fact. (run-until-halt) is a function; what you've done here is assert
a fact (run-until-halt) which, despite the similar apeparance, is
absolutely unrelated to what you want to do.
2) The function you meant to call, (run-until-halt), does not return
until (halt) is called - i.e., the below code will never be
executed. If you want to call (run-until-halt) and then make more Java
calls from the same method, you need to make the (run-until-halt) call
in a separate Thread.
> ===================================================
> test.clp
> ===================================================
> (set-reset-globals nil)
You've got no global variables in this program, so this has no effect.
> My question is: why doesn't the 'Current State after
> assert on handle-up' say 'handle-up'?
>
> Thanks in advance.
The rest of your code is correct, as far as I can see. It generally
helps when developing this sort of code to 1) Get the Jess code
working by itself, first, interactively. Only when it does what you
expect should you then embed it in a Java application. 2) use the Jess
command (watch all) so that the engine tells you what it's doing; this
would have let you know that your rules were never firing because no
form of (run) was being called.
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
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]
---------------------------------------------------------------------