swarm-modeling
[Top][All Lists]
Advanced

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

Re: Q: ActivityGroup Class & Land Uses


From: Benedikt Stefansson
Subject: Re: Q: ActivityGroup Class & Land Uses
Date: Wed, 24 Nov 1999 16:17:58 -0700

Kevin,

Marcus already covered some of these points while I was writing the message,
however in the interest of verbiage...

The best way to think about activity groups, schedules and activity is to think
of them as nested ordered lists. After you define each action group and events
on schedules and 'activate' the schedules activity groups are merged into
schedules and schedules into the activity in effect by constructing one large
list (the aggregate schedule so to speak).

In the present configuration of Swarm the order in which events are defined and
schedules activated  in your code determines how methods will be called in the
program. I.e. first event in the first activity group on the first schedule to
be activated is executed first etc (this was a recent topic of discussing
w.r.t. to ObserverSwarm/ModelSwarm and when GUI is updated).

I think your example would be a prime candidate for doing away with repeated
schedules and scheduling all events dynamically. A plot that gets seeded with a
crop sends a message to schedule N growth events in sequence. When the plot
goes fallow at the end of the growing period it schedules a new sequence of
growth after M periods in the future etc. In the long run this might allow you
to experiment with more heterogeneity in the event structure.

I learned a lot about the pitfalls of Swarm scheduling by writing two examples,
included here . One is a silly little example, based on the simpleBug tutorial,
where food is regrown in the lattice as bugs eat it up. Food growth is
rescheduled for each lattice location when a bug gobbles up the square. There
is a tiny bit of documentation there in the form of an html file.

The canonical dynamic schedule demo is of course mousetrap.

The app in the other tarball shows colored blocks on a raster to give visual
feedback as to when events are executed, using different types of 'repeated
scheduling' as it were. Compile and then single step with 'next' in the control
panel. It might be a suitable template for a workbench if you need to debug
some scheduling problems.

Benedikt

Attachment: scheduledemo.tar.gz
Description: GNU Zip compressed data

Attachment: simpleObserverBug-growth.tar.gz
Description: GNU Zip compressed data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]