swarm-support
[Top][All Lists]
Advanced

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

Re: restarting runs


From: Ken Cline
Subject: Re: restarting runs
Date: Mon, 30 Jun 1997 15:15:49 -0400 (EDT)

I'm not sure if this will help a lot, but we added a button
to the control panel once.  The purpose of the button was
to put our swarm simulation into "remote control" mode.

How it worked was that we would start Swarm and another
simulation.  The Swarm simulation would wait until the other
simulation wrote to a particular file.  When this happen
Swarm would read this file and perform the desired action
(typically step one sim-cycle and then wait again).  This
was a *very* quick first hack at tying together two
simulations.

We are not using this feature any more but the button is
still there.

Here are changes we made to add the "remote control" button:

In simtools/ControlPanel.m:
---------------------------
@Line 16:
   id ControlStateRemoteControl;

@Line 35:
   [panel addButtonName: "Remote Control" Command: "simctl 
setStateRemoteControl"];

@Line 115:
   // Remote control:
   -setStateRemoteControl {
      while (1){
         if ( !getTopLevelActivity() )
            break;
         }
      return [self setState: ControlStateRemoteControl];
   }


In simtools/GUISwarm.m:
---------------------------
@Line 64:
    } else if (controlState == ControlStateRemoteControl) {
           ...
       code to perform while in this "controlState"
           ...
    } else {
       [controlPanel setStateStopped];
    }


I think those are the only relevant changes but I can't be
sure since I did not add the remote control feature.

NOTE: What we did is probably *incorrect*!  I think it would
be better to override "ControlPanel" and GUISwarm" with
*inheritance* rather than make changes to those files
directly, especially if ever plan to upgrade the swarm
libraries.

As far as resetting the simulation, I haven't tried to do
that; but I would guess that you'd keep the Observer (or
Batch) swarm and recusively drop the rest (i.e. everything
from the Model swarm on down).  (I thought Chris (Langton)
contributed a example simulation that did something like
that.)

You might want to store your "seeds" in a file and have the
Observer (or Batch) swarm load them in as needed (e.g. the
ObjectLoader in the HeatbugBatchSwarm).

I hope that was somewhat useful.

Ken.


On Tue, 1 Jul 1997, Alex Lancaster wrote:

> I too, would be interested in such a beast! Having to
> quit and then re-run the app from the command line, all
> the time can be a bit of a drag! 
> 
> I suppose the best way to do this is to add a "Reset"
> button to the "Swarm" Go window - but you might have to
> delve into the libraries to figure out how to do it! It
> might involve creating a new Tk/Tcl widget. Anybody? I
> will have a look at it if I can get time...
> 
> Alex
> 
> At 10:25 AM 30/6/97 -0400, you wrote:
> > Does anybody have a suggestion as to a good way (or the "right way",
> >if such a thing exists) of restarting (from the beginning) a
> >simulation run (with either the same or different random number
> >generator seed). I would like to be able to run my sim over and over
> >again with different initial parameter settings. Currently, using the
> >ObserverSwarm hacked from heatbugs, I have to kill the program and
> >start it up again, with all of the attendent overhead.
> >
> >Thanks
> >
> >Jim
> >address@hidden
> >
> >
> ////////////////////////////////////////////////////
> 
>   Alex Lancaster
>    e-mail: <address@hidden>
>    tel: +61-2-9565-5774 (home)
>    web: http://www.real.net.au/~alex
> 
> ////////////////////////////////////////////////////
> 

_________________________________________________________
Ken Cline                             address@hidden
SAIC                                 VOICE (410) 571-0413
Annapolis, MD                          FAX (301) 261-8427



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