swarm-support
[Top][All Lists]
Advanced

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

Re: New Swarm utility: Runtime scripting


From: Benedikt Stefansson
Subject: Re: New Swarm utility: Runtime scripting
Date: Fri, 06 Feb 1998 16:38:45 -0800

Hi Rick et al,

> This sounds like a very useful utility.

Thanks, I hope you find use for it.

> Amoung other things, it seems to me it could be used
> in conjunction with the Probe-change-notification hooks
> to record user-instigated events (eg change a value
> via a Probe) so that a user-GUI-controlled
> run could be replayed.

Yep, you are absolutely right. It certainly is a piece of functionality I'm
itching to have on hand.

This is my own messy hack, so that there are (hidden) classes in Script that
act as pseudo-schedules and create a probe on the fly to send messages to the
agents. Handling the reverse path, i.e. from probes back to an object that
would write the script out to a file would require someone to go into the
probe library and change things around there. I thought that might be a better
job for the Hive meisters.

Since Marcus and Alex are hacking away at the probe interface to integrate the
Java GUI into Swarm, I humbly suggest that they might take this under
consideration - it may not be as hard as it sounds.

I haven't studied it seriously, but it seems to me that a simple subclass of
MessageProbe and VarProbe is required. This new subclass would have to be
initialized with a pointer to an outfile and then when it generates a method
call it fprintfs to the outfile (in the format that I adopted):

    target timestep method_name arg1 ... argN

Admittedly this file could not be executed directly by Script, because the
first field - target - has to be substituted by the name of the "getX" method
that retrieves a pointer to target X in the swarm that activates the Script.
But transforming the file is trivial, only requires a simple Perl script that
searches for the string get\(target\) in the header file for that swarm and
substitutes into the probe generated script.

-Benedikt

------------------
Benedikt Stefansson                 address@hidden
Department of Economics, UCLA       Fax. (310) 825-9528
Los Angeles, CA 90095-1477          Tel. (310) 825-1777



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