Example #1
0
 /// <param name="">facts
 /// </param>
 /// <param name="">engine
 /// 
 /// </param>
 public override void assertFacts(Index inx, Rete engine, IWorkingMemory mem)
 {
     long time = (DateTime.Now.Ticks - 621355968000000000)/10000;
     if (theRule.ExpirationDate > 0 && time > theRule.EffectiveDate && time < theRule.ExpirationDate)
     {
         LinkedActivation act = new LinkedActivation(theRule, inx);
         act.TerminalNode = this;
         // fire the activation immediately
         engine.fireActivation(act);
     }
 }
Example #2
0
 /// <summary> Method will call checkFacts() first to make sure none of the facts have
 /// expired. An activation is only created if the facts are valid.
 /// </summary>
 /// <param name="">facts
 /// </param>
 /// <param name="">engine
 /// 
 /// </param>
 public override void assertFacts(Index inx, Rete engine, IWorkingMemory mem)
 {
     // first check the facts and make sure they didn't expire
     if (checkFacts(inx, engine, mem))
     {
         LinkedActivation act = new LinkedActivation(theRule, inx);
         act.TerminalNode = this;
         if (temporal)
         {
             engine.fireActivation(act);
         }
         else
         {
             IGenericMap<Object, Object> tmem = (IGenericMap<Object, Object>) mem.getTerminalMemory(this);
             tmem.Put(inx, act);
             // Add the activation to the current module's activation list.
             engine.Agenda.addActivation(act);
         }
     }
 }