swarm-support
[Top][All Lists]
Advanced

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

Re: How to synchronize actions?


From: Paul E. Johnson
Subject: Re: How to synchronize actions?
Date: Wed, 17 Feb 1999 10:53:49 -0600

Fabio Mascelloni wrote:
> 
> "Marcus G. Daniels" wrote:
> 
> >
> > How about having each worker Swarm schedule a `recordResult:' on the
> > blackboard Swarm?  recordResult: could check to see if there is a full
> > batch of results and either do nothing, or commence a review.  The
> > review would result in new jobs being scheduled on each worker Swarm.
> >
> > In other words, Schedule is the feature for synchronizing things in Swarm.
> 
> I'm sorry,but I've not understood.Each subSwarm schedule is made up of about 3
> actions to be scheduled:
> 
> subActions=[ActionGroup create self];
> [subActions createActionTo: self message: M(process_Message)];
> [subActions createActionTo: blackboard  message: M(get_My_message)];
> [subActions createActionTo: self message: M(process_blackboard_Message)];
> 
> subSchedule=[Schedule createBegin:self];
> [subSchedule setRepeatInterval:1];
> subSchedule=[subSchedule createEnd];
> [subSchedule at: 0 createAction: subActions];
> 
> The schedule should be interrupted between action 2 and 3,until the blackboard
> has processed its own message.
> Fabio.
>
Sometimes code snips like this can be deceiving. Using the standard
swarm terminology, are these snips from ModelSwarm or are they from some
object/class?  I suspect the latter, and there was some talk of the
problem you describe a few months ago when Sven T wanted to structure
things like you want to. As I recall, the answer was that you should
reorganize your simulation to put the schedule in the ModelSwarm and in
the model swarm you put the objects/agents in a list and then the
schedule command in ModelSwarm is a "createActionForEach" method that
tells each object to do its job. You write a method inside the object
which responds, possibly "processMessage" that you already have will
work, maybe not. Next in ModelSwarm, you schedule the blackboard object
to do what it needs to, possibly to calculate something. WHen the
schedule runs again, your objects access the blackboard and do what they
need to do.  Your object's processMessage should be written so that each
object in the list is going to then be able to ask blackboard for
information and act accordingly.

I recall from that discussion the view seemed to be that it is not
possible to interleve/coordinate schedules from inside objects. Instead,
you do it by putting the proper schedule commands one level above in the
swarm hierarchy.

Of course, I'm wrong a high percentage of the time (:>


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