swarm-support
[Top][All Lists]
Advanced

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

Re: Optimization (was Re: Scheduling


From: Marcus G. Daniels
Subject: Re: Optimization (was Re: Scheduling
Date: 30 Mar 2001 13:45:45 -0800
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "PJ" == Paul E Johnson <address@hidden> writes:

PJ> In the ExampleCode archive (in SwarmFaq directory of my site), I
PJ> have a series of programs "pjrepeaterX" which show various
PJ> scheduling concepts and I too get a big slowdown when each agent
PJ> is a swarm and maintains its own schedule and they are merged
PJ> theough the hierarchy.

Paul sent me some profiles, and in his case the big slowdown was due
to using a randomization policy to shuffle emergent concurrent
groups.  Consider a Swarm in a Swarm where both Swarms have a single schedule
that has repeat interval:

    _______________
   /   0 1 2 3     \
   |  [X A X B]v   |    Repeat interval 4  (1, 3, 5, 7 ...)
   |  ^        |   |                        A  B  A  B
   |  <<<<<<<<<<   |
   |  ___________  | 
   | /   0 1 2   \ |
   | |  [X C X]v | |    Repeat interval 3  (1, 4, 7, 10 ...)
   | |  ^      | | |                        C  C  C  C
   | |  <<<<<<<  | |
   | \___________/ |
   |               |
   \_______________/

In this case, at time steps 1 and 7 (etc), there will be pairs of
actions that co-occur (AC and BC).  Swarm has a flag you can set that
says, make it run randomly as (AC or CA) and (BC or CB).  This is
feature is provided to help the modeler avoid simulation artifacts
which sometimes result from agents being created in some particular (but
arbitrary) order.

It is this `shuffling' that made the big slowdown for Paul.  The
slowdown for using embedded Swarms turns out to be higher than it
should be in some cases, as well (I'll work on this), but the modularlity
and clarity achieved by writing complex agent-based models in this way
vastly outweights the performance cost, IMO.

[I think rather than spend much time on improving the performance of
shuffling, it would be be better to dig in to spawning threads for
these cases of concurrency, since that would achieve the same effect
(non-determinism when non-determinism is called for).]

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