swarm-support
[Top][All Lists]
Advanced

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

Re: re-start run online


From: Marcus G. Daniels
Subject: Re: re-start run online
Date: 30 Aug 2000 08:11:58 -0700
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.4

>>>>> "RLR" == Rick Riolo <address@hidden> writes:

RLR> i am pretty sure i have seen some mention of examples of
RLR> swarmapps that have a button to allow re-starting of a run in gui
RLR> mode. 

The idea is to drop the top level SwarmActivity and recreate it,
i.e. re-activate the ObserverSwarm, cleaning up whatever GUI stuff is
appropriate.  

For heatbugs, see the attached patch for how you might put a
reactivation loop around the ObserverSwarm.

However, if what you want is to have the ObserverSwarm have an ongoing state,
but run different model Swarms, then you need to have some hooks in
your ObserverSwarm to reset graphs, etc.  Otherwise, you'll have the extend
the loop below to drop and recreate everything.

Btw, it tends to be confusing (to use) if you put GUISwarms in GUISwarms.

Index: HeatbugObserverSwarm.m
===================================================================
RCS file: /cvs/hive/Swarm/heatbugs/HeatbugObserverSwarm.m,v
retrieving revision 1.33
diff -c -r1.33 HeatbugObserverSwarm.m
*** HeatbugObserverSwarm.m      2000/08/24 21:36:34     1.33
--- HeatbugObserverSwarm.m      2000/08/30 15:03:02
***************
*** 96,101 ****
--- 96,102 ----
    // chance to fill in parameters before the simulation runs
  
    [controlPanel setStateStopped];
+   xprint ([controlPanel getState]);
  
    // OK - the user has specified all the parameters for the simulation.
    // Now we're ready to start.
Index: main.m
===================================================================
RCS file: /cvs/hive/Swarm/heatbugs/main.m,v
retrieving revision 1.23
diff -c -r1.23 main.m
*** main.m      2000/02/29 00:54:35     1.23
--- main.m      2000/08/30 15:03:02
***************
*** 40,47 ****
  
    [theTopLevelSwarm buildObjects];
    [theTopLevelSwarm buildActions];
!   [theTopLevelSwarm activateIn: nil];
!   [theTopLevelSwarm go];
  
    // theTopLevelSwarm has finished processing, so it's time to quit.
    return 0;
--- 40,53 ----
  
    [theTopLevelSwarm buildObjects];
    [theTopLevelSwarm buildActions];
!   while (1)
!     {
!       id <SwarmActivity> activity = [theTopLevelSwarm activateIn: nil];
! 
!       [theTopLevelSwarm go];
!       [activity drop];
!       [[theTopLevelSwarm getControlPanel] setStateStopped];
!     }
  
    // theTopLevelSwarm has finished processing, so it's time to quit.
    return 0;

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