swarm-support
[Top][All Lists]
Advanced

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

Re: Dynamic scheduling bug squashed?


From: Dominique Jacquel
Subject: Re: Dynamic scheduling bug squashed?
Date: Mon, 01 Feb 1999 15:58:50 +0000

hi all,

I keep seeing these dynamic scheduling bugs messages so I though I would
try to contribute my 2 cents/Pennies/Centimes .. (whatever you use!)

I use Swarm 1.3.1 in a mechanical Engineering application where agents
dynamically and autonomously create their schedule as they go. I indeed
encountered a problem when the schedules become empty ... When it does,
no further insertion in the schedule will be executed. Here is how I
solve the problem. It is a dirty hack but it works.

I am not really interested in having all my agent working at the same
time so this assume only one agent at a time is performing an action. I
create a FirstFreeTime variable in my modelSwarm. This is used by all
agent when scheduling an new action. It represent the next available
time slot for an agent to schedule an action at. An insertion looks like
that:

- scheduleMyAction:(id)me
{
  [modelSchedule 
    at: firstFreeTime 
    createActionTo: me 
    message: M(triggerAction)];
  firstFreeTime++;
  return self;
}

The trick is to prevent the schedule from becoming empty so I use a
function called keepalive to fill up the schedule when it is not used by
any agent. It is called once at swarm activation and will only use the
schedule when no new actions are in it :-).

- keepAlive
{
  // keep the system alive by updating firstFreeTime when there is
  // no agent activity - prevents GetCurrentTime > firstFreeTime.

  if (getCurrentTime() >= firstFreeTime) 
    {
      firstFreeTime = getCurrentTime()+1;
      Behavioural_Activity = NO;
    }
  else
    {
      Behavioural_Activity = YES;
    }
  [modelSchedule at: firstFreeTime createActionTo: self
Message:M(keepAlive)];

  return self;
}

This way of doing things works fine for me. My agents are self-scheduled
and are not affected by their shedule becoming empty. When no agent
actions are scheduled, the keepalive function will make sure
FirstFreeTime remains > to CurrentTime by repeatidly adding itself
[keepAlive] to it.

I've got no experience with 1.4 yet but I hope this can still help
someone.

dom.


Geoffrey Schultz wrote:
> 
> I was pleased to see that the dynamic scheduling bug was supposed to be
> squashed for 1.4, however, I'm still having problems with it after
> upgrading to the 1.4 distribution.
> 
> Essentially, the "bug" still appears if there is NO future pending
> action created for a schedule during the method in which schedules are
> set up, then at some time into
> the simulation, an object from a different swarm tries to insert an action
> onto the schedule.  As described in the notes, the action will be executed
> if the schedule already has pending action at some future time into the
> simulation (so the bug is squashed in so far as it is described), but
> again, it will not execute if the schedule is initially empty, and another
> swarm inserts an action onto the schedule (to be executed at a future
> time).
> 
> Has anyone else found this? Is this a known limitation to the new dynamic
> scheduling? Is my question clear?
> 
> Geoff Schultz
> 
> McGill-Montreal General Hospital
> Pain Centre
> 
>                   ==================================
>    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]