swarm-support
[Top][All Lists]
Advanced

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

Re: bug in autoDrop?


From: Doug Donalson;
Subject: Re: bug in autoDrop?
Date: Thu, 10 Jul 1997 15:09:59 -0700 (PDT)

Hi,

   I don't know what you have and haven't done, so forgive me
if I repeat something youv'e already done.  Given the disclaimer,
here is what I would do next.  

You need to find out whether the action you are looking at is
really being executed.  The action is directed to the last
monkey on your list, check R for it, the autodrop schedules sometimes 
seem to have a hard time getting started.  If it is 0 or 1 that may
be a problem.  Try making sure that you have at least a couple of display 
messages executed before your first asynch event.  (I start my display 
schedules at time 0 and my simulation at time 10.)

Also, put a print statement in TODO that prints when it is executed and 
change your monkeys so that they don't schedule any new TODO messages
(just for debugging).  Now if they are actually executing, you should see 
listCount number of messages and no more.

Let me know what happens and have faith, I have a four agent lattice 
based metapopulation model with fairly complex 2-level scheduling using 
auto drop that is working (at least I think so?!...), so you should be up 
and running soon.

Cheers,

   Doug

***************************************************************************
* 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             *
*   heralds new discoveries, is not "EUREKA" (I have found it) but        *
*   "That's funny ...?"                                                   *
*                                                                         *
*       Isaac Asimov                                                      *
*                                                                         *
***************************************************************************


On Thu, 10 Jul 1997, Mirjana Majdandzic wrote:

> Hi,
> Thank you for your suggestions on the autoDrop problem. 
> 
> I tested whether autoDrop really dropped the action in the following way:
> (In BuildObjects in ModelSwarm, where the first generation of my agents
> (i.e. monkeys) are created)
> **************
>  counter = [monkeyList getCount];
>   for (i = 0; i < counter; i++) {
>     R = [uniformIntRand getIntegerWithMin: 1 withMax: 10]; 
>     debugActionptr = [modelSchedule at: R createActionTo: [monkeyList 
> atOffset: i] 
>                                   message: M(TODO)];
> 
> (after this, they schedule themselves)
> **************
> I checked every timestep whether the object to which "debugActionptr" refers 
> still existed:
>   [debugActionptr xprint];
> If the action would really been dropped,  an error should be given (as far as 
> I know),  
> but the program continued to return a value (0x81a1dd8: ActionTo_0).
> (When I explicitly dropped debugActionptr, an error indeed occured).
> 
> Following Doug's suggestion, I also checked in Schedule.m, in nextAction, 
> if "debugActionptr" ever was equivalent to "removedAction":
> **************  
>   if ( ((Schedule_c *)collection)->bits & BitAutoDrop ) {
>      printf("Bitautodrop= %d\n", BitAutoDrop); // for debugging
> 
>      removedAction = [super remove];
> 
>      if (removedAction == debugActionptr) { // for debugging
>        printf("removedAction == debugActionptr\n");
>      }
>      [debugActionptr xprint];   // for debugging
>      [removedAction xprint];    // for debugging
> 
>      [removedAction dropAllocations: 1];
>    }
> *************
> They never were equivalent, so debugActionptr does not enter this loop.
> I still think the actions are not really dropped, if this is the right way to
> check it (?).
> I hope this helps to clarify the problem.
> 
> Bye,
> Mirjana
> 
> 
>                   ==================================
>    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.
>                   ==================================
> 

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