termites
simulate a population of termites
termite -help
or
termite
[-width integer] [-height integer] [-num integer]
[-dense double] [-steps integer] [-seed integer]
[-inv] [-mag integer] [-term string]
Simulates a population of termites which do a random walk while possibly carrying a wood chip. Under normal circumstances, 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 it bumps into a chip, then it picks it up, reverses direction, and continues with the random walk. If it is carrying a chip and bumps into another, it drops the chip, turns around, and starts walking again. Otherwise, it just does a random walk whether it is carrying a chip or not.
Simulate a population of termites which do a random walk while possibly carrying a wood chip. Under normal circumstances, 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 continues 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 random walk whether she is carrying a chip or not.
Miscellany
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 probability.
Bugs
No sanity checks are performed to make sure that any of the options make sense.
Options
-width | Width of the plot in pixels. | 100 |
-height | Height of the plot in pixels. | 100 |
-num | Number of termites in population. | 20 |
-dense | Density of chips at start. | 0.3 |
-steps | Number of simulated steps. | 10000000 |
-seed | Random seed for initial state. | 0 |
-inv | Invert all colors? | False |
-mag | Magnification factor. | 2 |
-term | How to plot points. | None |