swarm-support
[Top][All Lists]
Advanced

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

Re: Instantiating multiple ModelSwarms


From: Paul E Johnson
Subject: Re: Instantiating multiple ModelSwarms
Date: Wed, 18 Jul 2001 10:38:34 -0500

Fred Wan wrote:
> 
> Hi,
> 
> In the swarm tutorial the last example is ExperSwarm. In it is shown how
> multiple ModelSwarms can be instantiated and deleted after they have run.
> This example is, of course, very instructive and useful when trying to run a
> series of experiments with slightly different parameter settings. However,
> there are some differences with the schemes of running the ModelSwarms
> compared to the previous examples (SimpleObserverSwarm, etc.). These
> differences have raised some questions which I am unable to resolve using
> the online documentation.
> 
> In SimpleObserverBug2 ObserverBug.java (follows the same structure as the
> ObjC version), in buildObjects a modelSwarm and display objects (ZoomRaster,
> Value2dDisplayImpl and Object2dDisplayImpl) are created and are used to show
> the bugs' activities. In buildActions an ActionGroupImpl is created to send
> scheduled messages to these objects for which a ScheduleImpl object is
> created. In activateIn the schedules of modelSwarm and of the display
> objects is created:
> 
>         modelSwarm.activateIn(this);
>         displaySchedule.activateIn(this);
> 
> Now, in ExperSwarm the display objects are left out because we're going to
> run several models and we need to look at what's happening at a higher leve.
> One control panel is created together with one probe for the different
> modelSwarms. In ExperSwarm.buildActions an actiongroup is created that lists
> the different messages that are sent out to the objects in one run of a
> modelSwarm (buildModel, runModel, ..., dropModel).
> 
> In activateIn, only this schedule gets activated (and not a displaySchedule,
> because it is left out).
> 
> In buildModel, the modelSwarm is activated with:
> 
>         modelSwarm.activateIn(null);
> 
> My first question is: what difference in effect have the arguments "this"
> (SimpleObserverBug2) and "null" (SimpleExperSwarm)?
> 
> In runModel the modelSwarm is activated with:
> 
>         modelSwarm.getActivity().run();
> 
> This is somehow needed to activate the modelSwarm but again it is different
> with the way in which it is done in SimpleObserverBug2. What exactly is the
> difference?
> 
> I want to parameterize my code in a way that I am able to run batches, but
> also to see what is happening using the ZoomRaster etc. machinery. I tried
> to do this in several ways, but I have not been successful.

You and I have a lot in common. I tried that for a long long time with a
project I called RepeatingHeatbugs.  It sorta worked, for some versions
of Swarm. Eventually, since it never worked properly, we (the swarm guys
and I) went around and around on this and in the end the advice I got
was to give up on that approach, and rather start a new program with
command line parameters for each run.  I personally think we ought to
get rid of that Experiment Swarm thing in the swarmapps distribution,
because it gives you hope and then crushes you.  

Instead, I recommend you follow the approach outlined here:
http://lark.cc.ukans.edu/~pauljohn/ps909/simpleObserverBug3-6.tar.gz

I think (hope, believe) a version of that will appear in the next
swarmapps release.  Today, I have just done some tweaks to make this run
with Today's swarm snapshot, so it should be all clear sailing.

Please note, on the java side of things, I recently posted a number of
java command line argument passing examples that Sven T prepared, along
with a memo from him about it. If you don't find it in SwarmOnlineFaq,
email me.  Also, please look in the README,where I explain how to get
snapshots of the screen in an automated fashion. In java, you don't have
CPP flags, so I guess you have to create an variable somewhere that
conditionalizes the model's run/stop/snapshot behavior.

pj
> 
> The general question is now how to do this, i.e., how to add the display
> objects (of SimpleObserverSwarm etc.) to ExperSwarm. Is there an extra Swarm
> in between necessary perhaps? The control scheme would then become:
> ExperSwarm -> ObserverSwarm -> ModelSwarm
> 
-- 
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]