swarm-support
[Top][All Lists]
Advanced

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

Re: rescheduling


From: Benedikt Stefansson
Subject: Re: rescheduling
Date: Wed, 21 Apr 1999 13:59:35 +0200

Hi,

> 
> In terms of programming in Swarm, I can summarize the three technical
> requirement from Swarm:
> (1) building into and deleting objects from an activated swarm;
> (2) building into and deleting actions for an object in the swarm;
> (3) building into and deleting from an activated swarm schedules of
> these actions.
> 

Most of this is very straightforward. You can create schedules with no
actions and add them later. Take a look at the demo program
"simpleObserverBug2-growth" which does just that contained in this tar
archive:

ftp://ftp.santafe.edu/pub/swarm/users-contrib/anarchy/swarmfest99-demos.tar.gz

Here regrowth of the food resource in the simpleBug demo is implemented
by dynamic  scheduling of growth events. When this demo was written
there was a bug/feature in Swarm which prevented an object in one Swarm
from scheduling events in another, but I think that has been fixed now.

Creation of objects and deletion is of course straightforward. If you
subclass from SwarmObject (or defobj for that matter) you inherit the
-create: aZone and -drop methods. Often you may have added objects to a
list, scheduled events over them etc. If an object belongs to a
collection and you have scheduled a method call to the entire list, the
only restraint you have to show is to -drop the object cleanly, one way
for example is to keep track of all objects that should be dropped in a
"reaperQueue" (list) and then to send the drop message to all of them
before the next method call goes out to the list when nothing else is
going on. This is somewhat application specific. 

The harder part is if method calls have been scheduled in the future
with a specific object as target which now may be dropped before the
message call is reached. I have not figured out a clean way to find and
drop the specific  method call from the schedule, maybe someone else can
provide a debugged example.

I also have a hunch that it may be problematic to drop a schedule, even
when it is empty. I don't want to go out on a limb and say that it is
OK, since it might leave dangling references somewhere - again maybe
someone can answer that question? (It should be very simple to design
around this restriction if it exists).

One recommendation: Start by building a small demo program where you can
implement some of these ideas and isolate problems. Then share it with
the list!

Regards,
Benedikt 


-- ---
Present coordinates: 
Dep. of Economics, Univ. of Trento, Via Inama 1, 38100 Trento, ITALY
Office: +39 0461 882246 Mobile: +39 0347 0415721 Fax: +39 0461 882222

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