termite - simulate a population of termites
[-width integer] [-height integer] [-num integer]
[-dense double] [-steps integer] [-seed integer]
[-inv] [-mag integer] [-term string]
Simulate a population of termites which do a random walk
while possibly carrying a wood chip. Under normal circum-
stances, the termites will self-organize and move the wood
chips into piles without a global leader. The termites'
behavior is dictated by the following set of rules: If a
termite is not carrying anything and she bumps into a
chip, then she picks it up, reverses direction, and con-
tinues with the random walk. If she is carrying a chip
and bumps into another, she drops her chip, turns around,
and starts walking again. Otherwise, she just does a ran-
dom walk whether she is carrying a chip or not.
Width of the plot in pixels.
Height of the plot in pixels.
Number of termites in population.
Density of chips at start.
Number of simulated steps.
Random seed for initial state.
-inv Invert all colors?
How to plot points.
The walking pattern of the termites is not actually a
strict random walk. Instead, at each time step they
randomly turn -45, 0, or 45 degrees with equal probabil-
No sanity checks are performed to make sure that any of
the options make sense.
Copyright (c) 1997, Gary William Flake.
Permission granted for any use according to the standard
GNU ``copyleft'' agreement provided that the author's com-
ments are neither modified nor removed. No warranty is
given or implied.