AI-Termites

 view release on metacpan or  search on metacpan

samples/termites.pl  view on Meta::CPAN


=over

=item --dim N

Number of dimensions of the world. Defaults to 2.

=item --world-size SIZE

The size of the world box, Defaults to 1.

=item --specie NAME

The name of the artificial termite subspecie to simulate.

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

=item --wood N

Piezes of wood in the simulated world.

=item --termites N

Number of termites in the simulated world.

=item --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.

=item --taken

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

=item --output FILENAME

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

=item --one-of N

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

=item --top N

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

=item --width W

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

=item --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.

=back

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



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

=head1 SEE ALSO

The idea about artificial termites comes from the book "Adventures in
Modeling" by Vanessa Stevens Colella, Eric Klopfer and Mitchel Resnick
(L<http://education.mit.edu/starlogo/adventures/>).

An online Artificial Termites simulation can be found here:
L<http://www.permutationcity.co.uk/alife/termites.html>.

The origin of this module lies on the following PerlMonks post:
L<http://perlmonks.org/?node_id=908684>.

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2011 by Salvador FandiE<ntilde>o,
E<lt>sfandino@yahoo.comE<gt>

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.


=cut



( run in 0.718 second using v1.01-cache-2.11-cpan-39bf76dae61 )