termites.pl - Artificial Termites
termites.pl [OPTIONS]
This script runs the Artificial Termites simulation provided by the Perl module AI::Termites.
The accepted options are as follows:
Number of dimensions of the world. Defaults to 2.
The size of the world box, Defaults to 1.
The name of the artificial termite subspecie to simulate.
The currently accepted ones are LoginquitasPostulo, NemusNidor, VicinusOcurro and PeractioBaro.
LoginquitasPostulo
NemusNidor
VicinusOcurro
PeractioBaro
Piezes of wood in the simulated world.
Number of termites in the simulated world.
The size of the boll that a termite will consider as its neighborhood. Defaults to 1/50 of the world size.
Every specie uses this parameter in a different way.
Represent on the drawings the pieces of wood that are actually being moved by some termite.
Prefix used for the file names of the generated PNGs. Defaults to output.
output
Save to file one of every N frames. Defaults to 5.
Exit the application when the number of iterations reachs the given number.
Number of pixels of the generated images. Defaults to 1024.
Generate TrueColor PNGs.
The default PNG format uses a 8bit indexed palette that is not correctly handled by some programs as ffmpeg or mencoder.
termites.pl --specie=VicinusOccurro --truecolor --output vo --one-of 1 --top 10000 termites.pl --specie=PeractioBaro --one-of 10 --near 0.02 --taken --dim 2 \ --truecolor --output pb --top 40000
In order to convert a set of PNGs into an animation, ffmpeg can be used as follows:
ffmpeg -i output-%05d.png video.mpg
The idea about artificial termites comes from the book "Adventures in Modeling" by Vanessa Stevens Colella, Eric Klopfer and Mitchel Resnick (http://education.mit.edu/starlogo/adventures/).
An online Artificial Termites simulation can be found here: http://www.permutationcity.co.uk/alife/termites.html.
The origin of this module lies on the following PerlMonks post: http://perlmonks.org/?node_id=908684.
Copyright (C) 2011 by Salvador Fandiño, <sfandino@yahoo.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.3 or, at your option, any later version of Perl 5 you may have available.
To install AI::Termites, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AI::Termites
CPAN shell
perl -MCPAN -e shell install AI::Termites
For more information on module installation, please visit the detailed CPAN module installation guide.