AI::Termites - Artificial termites simulation
use AI::Termites; my $termites = AI::Termites::VicinusOcurro->new(dim => 2, n_wood => 1000, n_termites => 100); $termites->iterate for 0..10000;
This module simulates a termites world based on the ideas described on the book "Adventures in Modeling" by Vanessa Stevens Colella, Eric Klopfer and Mitchel Resnick (http://education.mit.edu/starlogo/adventures/).
In this version, termites can move in a n-dimensional boxed space, and are not limited to integer coordinates.
Also, the way they decide when to pick or leave wood are customizable, allowing to investigate how changing the rules affects the emergent behaviors.
The module implements several termite subspecies (subclasses):
This termites subspecie measures the distance to the nearest piece of wood.
This termite smells the wood.
This termite is pretty simple and all that can see is if there is or not some piece of wood in the vecinity.
This termite counts the pieces of wood that there are on its vecinity.
If you want to use this module, you are expected to look at its source code!!!
The sample program includes in the distribution as
samples/termites.pl can run the simulation and generate nice PNGs.
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, <email@example.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.