Ah. OK.

When I described what (reset) does, I neglected to mention that
(definstances) are like (deffacts). Here's what the jess manual says about
(reset):

8.111. (reset)

Package: 
     Intrinsics 
Arguments: 
     None 
Returns: 
     TRUE 
Description: 
     Removes all facts from the fact list, removes all activations,
     then asserts the fact (initial-fact), then asserts all
     facts found in deffacts, asserts a fact representing each
     registered definstance, and (if the set-reset-globals property
     is TRUE) initializes all defglobals.  

If you want the definstances to disappear, you have to remove
them. You can do them one at a time, or use (undefinstance *).

One of the best parts about Jess 5, I thought, at least comapred to
previous versions, is the manual. The javadoc for the API functions is
still very weak, but the documentation for the Jess language itself
is, I think, now fairly complete.


I think Calicrates Policroniades Borraz wrote:
> On Mon, 7 Feb 2000, friedman_hill ernest j wrote:
> 
> > reset() removes all the facts, then asserts the fact (initial-fact),
> > then asserts all the facts that appear in any (deffacts)
> > constructs. The entire implementation of the Jess (reset) function is
> > 
> >       case RESET:
> >         context.getEngine().reset();
> >         break; 
> > 
> > So clearly the two do the same thing.
> >
> 
> Hi, my application creates a rete object, then immediatly executes a reset
> command, this action asserts the initial fact, as it must do it.
> Later each determined time (a simulation step) it receives an object that
> is included in the KB in this way:
> 
>             f = new Funcall("definstance", rete);
>             f.add(new Value("element", RU.ATOM));
>           f.add(new Value(objInMemory));
>             f.execute(rete.getGlobalContext());
> 
> After this, the program executes the method:
> 
>             rete.run();
> 
> The first time the rules that must be fired are fired. I want now to clean
> the KB of all the facts, therefore the program executes:
> 
>             rete.reset();
>             rete.executeCommand("(facts)");
> 
> Apparently the facts are not erased because the next command (the
> above facts) show me all the facts, even though I have executed the reset.
> The big problem is that the rule that must be fired only once in each step
> of the simulation recognizes the previous facts and the rule is fired
> several times in each step. Is this right? or Have I misunderstood the
> reset function?
> 
> Thank you in advance...
>             
> 



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

Reply via email to