swarm-support
[Top][All Lists]
Advanced

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

Re: Decentralized Scheduling


From: Paul E. Johnson
Subject: Re: Decentralized Scheduling
Date: Sat, 10 Jun 2000 10:54:29 -0500

"Marcus G. Daniels" wrote:
> It's actually broken in a subtle way right now.  I probably won't
> get to fixing it until I get back from vacation on the 18th. 

I realize Marcus is going on vacation and this question may sit a
while.  I'm in no hurry to have this work. I'm just trying to write this
down before I forget :)
 
> The method that is for customizing a Swarm's merge behavior is
> setSynchronizationType.  The idea is you'd customize a ConcurrentGroup
> type with randomization, and then customize a Schedule using that
> ConcurrentGroup, passing that to setSynchronizationType.

I **concluded/guessed** after some study that I need to make this
schedule & Swarm customization in the ObserverSwarm, so that the
modelSwarm it creates will have the right kind of synchronization. 
Since the citizens are using the modelSwarm as their context when they
schedule, isn't that right? In objective C, my ObserverSwarm now has:

   groupProto=[ConcurrentGroup customizeBegin: self];
    //[groupProto setDefaultOrder: Randomized]; //this one segfaults
    [groupProto setDefaultOrder: Sequential];  //should behave same as
default
   groupProto = [groupProto customizeEnd];

   syncScheduleProto = [Schedule customizeBegin: self];
   [syncScheduleProto setConcurrentGroupType: groupProto];
   //  [syncScheduleProto setAutoDrop: 1];  //played with this to try to
detect effect
   syncScheduleProto = [syncScheduleProto customizeEnd];
 
   modelSwarm = [ModelSwarm createBegin: self];
   [modelSwarm setSynchronizationType: syncScheduleProto ];
   modelSwarm = [modelSwarm createEnd];

  // modelSwarm = [ModelSwarm create: self];  //replaced by the previous

I believe that with "Sequential" order and commented-out autodrop, this
should make the simulation run like the default.  However, it does not,
the agents take the initial step and then don't take any more.  The
mechanism inside the Citizen.m is unchanged from the setup I described
when I asked this question: a citizen steps one time in response to
instruction from the Model, and after that a dynamic schedule inside the
Citizen controls the action. I've stepped through the code and the
agents do take one step and schedule themselves at a future time, but
then that future action never takes place.  Somehow, it never registers
with the scheduling mechanism?

In case you don't want to look up that last message from me, the
Citizen.m has this:

- scheduleYourselfAt: (int) x
{
  [schedule at: x createActionTo: self message: M(step)];
  return self;
}

- buildActions
{
  [super buildActions];
  schedule= [Schedule createBegin: self];
  [schedule setAutoDrop: 1];
  schedule = [schedule createEnd];

  return self;
}

- activateIn: swarmContext
{
   [super activateIn: swarmContext];
   [schedule activateIn: self ];
 
   return [self getActivity];
}


-step
{ 

//blah blah, do stuff

  [self  scheduleYourselfAt: getCurrentTime() +2];

  return self;
}

> The default behavior is that actions are merged in the order that its
> components are activated.
> 
> Like this:
> 
>     ScheduleC syncScheduleProto;
>     Object concGroupType, syncType;
> 
>     ConcurrentGroupC groupProto;
>     groupProto = new ConcurrentGroupCImpl ();
> 
>     groupProto.customizeBegin (aZone);
>     groupProto.setDefaultOrder (Globals.env.Randomized);
>     concGroupType = groupProto.customizeEnd ();
> 
>     syncScheduleProto = new ScheduleCImpl (new ScheduleImpl ());
>     syncScheduleProto.customizeBegin (aZone);
>     syncScheduleProto.setAutoDrop (true);
>     syncScheduleProto.setConcurrentGroupType (concGroupType);
>     syncType = syncScheduleProto.customizeEnd ();
> 
>     SwarmC swarm = new SwarmCImpl (this);
>     swarm.createBegin (aZone);
>     swarm.setSynchronizationType (syncType);
>     swarm.createEnd ();
> 
-- 
Paul E. Johnson                         email: address@hidden
Dept. of Political Science              http://lark.cc.ukans.edu/~pauljohn
University of Kansas                    Office: (785) 864-9086
Lawrence, Kansas 66045                  FAX: (785) 864-5700

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