swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dynamic schedules and execution speed


From: Rob Kewley
Subject: Dynamic schedules and execution speed
Date: Tue, 05 Aug 1997 23:40:16 -0300

My model uses a dynamic schedule, and I iterate that model many times. 
My current symptom is that the 1st iteration of the model takes 3
seconds and the 30th iteration takes 20 seconds.  It just gets slower
from then on out.  I create no new entities for later iterations.  I
simply reset all objects to their initial state and execute again.  I
don't believe this is caused by a memory leak because I created my own
concurrent group type as discussed in the "Bug in AutoDrop" postings to
this list arount 25 June.  This slow speed may be caused by the fact
that I terminate my dynamic schedule, remove all old action from it, and
reactivate it again in the model swarm for the next iteration.  Perhaps
each subsequent activation of the schedule leaves some clutter in the
model swarm which makes it more time  consuming to merge and control the
actions on the schedule???  Below is the code I use to accomplish this:

  // terminate dynamic schedule
  [schedActivity terminate];

  // remove all old actions
  if ([dynSchedule getCount]) {  // if there are actions on schedule
    [dynSchedule forEach: M(drop)];
    [dynSchedule removeAll];
  }

  // reinitialize schedule to place initial actions on it
  [self reinitialize];

  // reactivate schedule in the model swarm
  schedActivity = [dynSchedule activateIn: self];

Maybe there is a better way to stop and restart a simulation which uses
a dynamic schedule, but I don't know of one.  Any help would be greatly 
apprecitated.

Rob Kewley

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]