The following instructions describe how to make a movie from an Avida run.
== Step 1. Setup Avida to output the information you need. ==
The "dump_genotype_grid" event will create a file called
grid_genotype_id.####.dat where #### is the updated that the
file was output. The file will contain a matrix of genotype IDs indicating
the genotype of the organism at each grid position (and a -1 for empty cells).
You should make sure this event runs once for each frame you want in your
movie. For a 100,000 update run, I recommend that you use
u 100:100 dump_genotype_grid
which will allow you to generate a 1000-frame movie. For smoother detail, you
can print the file more frequently.
Now you can do the run.
== Step 2. Process the files with the process_map program. ==
Make sure that the process_map executable has been generated. To do this, go
into source/utils/process_map/ in your avida directory and type "make". You
should only need to do this once ever.
Next, go into the data directory that contains all of the output files for
the Avida run. Execute the process_map command in that directory
(you will need to provide its full path). If you run the command without any
arguments, it will give you its documentation. The command line options allow
you to specify exactly what type of movie you want to make.
The main three options that you will sue are "start", "step", and "stop". The
start option specifies the update at which you want to movie to begin. The
step option indicates how many updates you want between frames, and the stop
option indicates where you want the movie to end. Thus, you might run:
~/avida/devel/source/utils/process_map start=40000 step=20 stop=50000
if you have a run that you want to zoom in on the span between updates 40,000
and 50,000, showing frames every 20 updates, for a total of (50k-40k)/20 =
500 frames in the movie.
Many of the other options allow you to control the number of colors used. By
default we're using 65 colors, but the last 22 of them are rather dark, so
you may choose to just use the first 43 for a brighter movie. Do this by
setting "num_colors=43".
The "threshold1" and "threshold2" options specify when organisms should stop
getting the default colors, and start being assigned their own colors. Empty
cells are colored black. By default, genotypes that never pass an abundance
of 10 are colored dark gray, and those that never pass an abundance of 100
are light gray. These thresholds are the total number of organisms in those
genotypes, summed up across all of the frames in the movie. The default
values are tuned for very low mutation rates; you may very well want to use
much lower numbers here if you aren't seeing many colors.
Finally, the "num_demes" setting is used to tell the program if you are running
a deme-based population. If so, it will do a major re-arrangement of the board
so that all of the demes are neatly layed out in an easy-to-view fashion. Of
course, it'll probably crash if you lie about the number of demes...
When you run this program, it will assign colors to each genotype and print
out a file called "avida_movie.m".
== Step 3. Generate each frame of the movie with Matlab ==
Move the the avida_movie.m script generated in the last step into the
directory where you want the movie to be created. Launch matlab and cd into
this directory. Type "avida_movie" into matlab and wait. It'll take a couple
of minutes to load the script (exact times depending on the population size and
the number of frames you're creating). Then it will cycle through, drawing
each frame and outputing a .png file associated with it.
== Step 4. String the frames together with Quicktime Pro ==
Open Quicktime Pro (this is ~$30 if you want to buy a personal copy. We'll
also put it on the Mac in lab). Under the File menu, click on "Open Image
Sequence". Choose the first .png file that was just created in the last step
(it should be called "frame0.png") and press the "Open" button. It will ask
you how many frames-per-second to make the movie; I recommend 10 so that it
doesn't look like its stuttering. This will then take about 30 seconds to
assemble the full movie. Click "Save As" if you want to save it.
== NOTES: ==
- At the moment, colors are chosen for genotypes at random, so there is a
chance that two genotypes will have the identical color. This is one of
the first fixes I'll be making to this program.
- If you want to make a more interesting movie, you should make sure to use
a low mutation rate (or at least lower the color theresholds way down). At
very high mutation rates, genotypes never take over more than a small area,
and so you rarely see anything that looks like more than static.
Comments (0)
You don't have permission to comment on this page.