The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

termites.pl - Artificial Termites

SYNOPSIS

  termites.pl [OPTIONS]

DESCRIPTION

This script runs the Artificial Termites simulation provided by the Perl module AI::Termites.

The accepted options are as follows:

--dim N

Number of dimensions of the world. Defaults to 2.

--world-size SIZE

The size of the world box, Defaults to 1.

--specie NAME

The name of the artificial termite subspecie to simulate.

The currently accepted ones are LoginquitasPostulo, NemusNidor, VicinusOcurro and PeractioBaro.

--wood N

Piezes of wood in the simulated world.

--termites N

Number of termites in the simulated world.

--near SIZE

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.

--taken

Represent on the drawings the pieces of wood that are actually being moved by some termite.

--output FILENAME

Prefix used for the file names of the generated PNGs. Defaults to output.

--one-of N

Save to file one of every N frames. Defaults to 5.

--top N

Exit the application when the number of iterations reachs the given number.

--width W

Number of pixels of the generated images. Defaults to 1024.

--truecolor

Generate TrueColor PNGs.

The default PNG format uses a 8bit indexed palette that is not correctly handled by some programs as ffmpeg or mencoder.

EXAMPLES

  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

MAKING MOVIES

In order to convert a set of PNGs into an animation, ffmpeg can be used as follows:

  ffmpeg -i output-%05d.png video.mpg

SEE ALSO

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 AND LICENSE

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.