Aaaak! This looks like a case of overzealous cutting. The method
reset() in jess.Rete is missing the line

        m_activations.removeAllElements();

Looks like it's been missing for a few versions.

Here's a version of reset() with a nice doc-comment that you can cut
and paste into the 50a5 source:


  /**
   * Reset the Rete engine. Remove all facts, activations, etc. Clear all non-globals 
from
   * the global scope. Assert (initial-fact). Broadcasts a JessEvent of type RESET. 
   *
   * @exception JessException  If anything goes wrong.
   */

  public void reset() throws JessException 
  {
    
    synchronized (m_compiler)
      {
        removeFacts();
        m_globalContext.removeNonGlobals();
        m_activations.removeAllElements();
        m_nextFactId = 0;
        m_time = 0;
        assert(m_initialFact);
        JessException re = broadcastEvent(JessEvent.RESET, this);
        if (re != null)
          throw re;
      }
  }

Thanks, Bob! I'll mention this in the FAQ.

I think Bob Orchard wrote:
> 
> Consider the following simple program ...
> 
> (defrule r1
>   (f a)
> =>
>   (printout t OK crlf)
> )
> 
> Then the following actions are taken with Jess50a5 ....
> 
> Jess> (batch e:/alexis.eller/resetBug.clp)
> TRUE
> Jess> (watch all)
> TRUE
> Jess> (assert (f a))
>  ==> f-0 (f a)
> ==> Activation: r1 :  f-0
> <Fact-0>
> Jess> (reset)
>  ==> f-0 (initial-fact)
> TRUE
> Jess> (agenda)
> [Activation: r1  f-0 ; time=2 ; salience=0]
> For a total of 1 activations.
> Jess>
> 
> The fact f-0 was not retracted on the reset and the agenda was not cleared.
> 
> Bob.
> 
> ---------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
> in the BODY of a message to [EMAIL PROTECTED], NOT to the
> list. List problems? Notify [EMAIL PROTECTED]
> ---------------------------------------------------------------------
> 
> 


---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9214                  [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. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to