swarm-support
[Top][All Lists]
Advanced

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

Repeating GUI swarm apps: Trying to get something for almost nothing


From: Paul E. Johnson
Subject: Repeating GUI swarm apps: Trying to get something for almost nothing
Date: Wed, 18 Nov 1998 01:54:33 -0600

Dear Everybody:

I have been daydreaming about ways to make swarm sims repeat themselves.
Not in the batch mode, but in GUI mode, because I need to output pixmaps
of some widgets at certain time points.   

Has anyone used drone to repeat a non batchmode simulation? Everything I
see in the docs seems to aim at batch mode.  

I started thinking about writing a simulation in which there is a
ManagerSwarm which creates an Observer which creates a Model swarm, and
then the Manager drops the Observer  and creates new one. If the
ModelSwarm is created in the Observer, does dropping the Observer
automatically drop the Model?

I had a "brilliant" (stupid!) idea about how to cheat the devil.
Consider the standard heatbugs app, look at main.m, and put a for loop
in there that iterates the experiment.  At the end add a few statements
to drop the observerswarm and the for loop continues. For example, in
heatbugs's main.m:


main (int argc, const char **argv)
{
  id theTopLevelSwarm;
  int i;
  for(i=0; i<4; i++)
  {
  // Swarm initialization: all Swarm apps must call this first.
  initSwarmApp (argc, argv, "1.3", "address@hidden");

........all of the regular stuff in here, through the "go" message to
topLevelSwarm..........

  [probeDisplayManager dropProbeDisplaysFor: theTopLevelSwarm];
  [[theTopLevelSwarm getActivity] drop];
  [theTopLevelSwarm drop];
}
return 0;
}

............................
Sure, you laugh...  This almost works, except when it spawns the second
control panel, there is a massive splat of tcl/tk blt errors, as in:
(Tcl -eval:) bitmap "hide" is already defined
    while executing
"bitmap define hide {{16 16} {
    0x00, 0x00, 0x00, 0x00, 0x04, 0x80, 0x08, 0x40, 0x90, 0x27, 0x60,
0x18,
    0x60, 0x18, 0x90, 0x24, 0x10, 0x23, 0x10..."
[AND]
bitmap define super {{16 16} {
    0x00, 0x00, 0x00, 0x00, 0x7c, 0x08, 0x44, 0x04, 0x44, 0x7e, 0x44,
0x44,
    0x7c, 0x48, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x7c,
0x40,
    0x44, 0x40, 0x44, 0x7e, 0x44, 0x00, 0x7c, 0x00}}

proc send_id {interp ddwin data} {
    global DDOBJ
    set DDOBJ $data
    drag&drop target $ddwin handle id
}

proc gimme {asdf} {
    return $asdf
}

I've experimented writing a "dropAllYerStuff" method of the
heatbugObserverSwarm, and that does succeed in clearing out the GUI
objects too, but seems like there's nothing can do to get rid of this
tcl/tk error.

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