[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Swarm-Support] Taking screen shots and conducting experiments
From: |
Steve Railsback |
Subject: |
Re: [Swarm-Support] Taking screen shots and conducting experiments |
Date: |
Sat, 08 Nov 2003 10:00:11 -0800 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 |
steven brandenburger wrote:
Hi
How can I take screen shots of experiments in swarm?
Well, you are familiar with Swarm's PixMap class? Here is some code that
takes a picture of a raster window ("worldRaster" in this case) and
writes it in a new file. You can put this method in your observer swarm
and execute it every time through the schedule.
Then if you want you can make a GIF movie out of these snapshots- I use
some shareware called GIF Construction Set, which you can find on the web.
If you skip the line: [pixID setWidget: worldRaster];
then it will take a picture of the entire screen.
-(void) writeFrame {
char filename[256];
id pixID;
sprintf(filename, "Frame%03ld.png", getCurrentTime());
pixID = [Pixmap createBegin: [self getZone]];
[pixID setWidget: worldRaster];
pixID = [pixID createEnd];
[pixID save: filename];
[pixID drop];
}
An alternative, however, is software like "SnagIt" that will capture a
movie of anything on the screen- you can turn its movie capture on, then
start you model, and run it as long as you want. It's easy to make a 50
mByte .avi file in no time.
How could I conduct experiments with swarm....are there some web pages
that expand on this....
Not sure what you mean...how to design experiments? Software to
automatically run scenarios and replicates?
Steve R.