swarm-support
[Top][All Lists]
Advanced

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

scheduling actions


From: Doug Donalson;
Subject: scheduling actions
Date: Tue, 22 Apr 1997 23:57:21 -0700 (PDT)

Can anyone tell me why I am getting this error?

I wrote a function to seed the population values in
my model over a number of time steps.  I create a seperate
schedule for the seed operation with autoDrop=1 and then
insert actions with message to myself "seed" at several
sucessive times.  The problem is that imstead of executing
it once in a particular time perion it does it 100 times!

What is going on????

Here is the function seed:

-seed
{
int chimera;
id list1,list2,index;
AphytisCell * anAphytisCell;
AdultAphytis *anAdultAphytis;
JuvenileRedScale *aJuvenileRedScale;
   
   index = [aphytisCellList begin: [self getZone] ];   
   anAphytisCell=[index next];   
   list1=[anAphytisCell getAdultAphytisList];   
   list2=[anAphytisCell getJuvenileRedScaleList];   
   for( chimera=0; chimera < 1; chimera++ )   
   {       
      anAdultAphytis=[AdultAphytis create: [self getZone]];
      [list1 addLast: anAdultAphytis];       
      [anAdultAphytis setModel: self];       
      [anAdultAphytis setStats: myStats];       
      [anAdultAphytis setMyCell: anAphytisCell];       
      [anAphytisCell incrementAdultAphytis];       
      [myStats incrementAdultAphytis];
      [anAdultAphytis firstEvent];       

      aJuvenileRedScale=[JuvenileRedScale create: [self getZone]];       
      [list2 addLast: aJuvenileRedScale];
      [aJuvenileRedScale setModel: self];
      [aJuvenileRedScale setStats: myStats];       
      [aJuvenileRedScale setMyCell: anAphytisCell];
      [anAphytisCell incrementJuvenileRedScale];
      [myStats incrementJuvenileRedScale];       
      [aJuvenileRedScale firstEvent];       
   }   
   [index drop];   
   return nil;
}

Here is the schedule creation:

modelSchedule = [Schedule createBegin: [self getZone]];  
[modelSchedule setAutoDrop: 1];  
modelSchedule = [modelSchedule createEnd];

Here is the event insertion:

     [modelSchedule at: 18 createActionTo: self message: M(seed)];

I am sure I'm doing something stupid but I cannot figure it out!

Cheers,

   Doug Donalson


***************************************************************************
* Doug Donalson                          * Office: (805) 893-2962         *
* Ecology, Evolution, and Marine Biology * Home:   (805) 961-4447         *
* UC Santa Barbara                       * email address@hidden
* Santa Barbara Ca. 93106                *                                *
***************************************************************************
*                                                                         *
*   The most exciting phrase to hear in science, the one that             *
*   hearlds new discoveries, is not "EUREKA" (I have found it) but        *
*   "That's funny ...?"                                                   *
*                                                                         *
*       Isaac Asimov                                                      *
*                                                                         *
***************************************************************************



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