The Computational Beauty of Nature
Source code

vants

simulate a population of generalized virtual ants

Full screen →

vants -help
  or
vants  [-width  integer]  [-height integer] [-num integer]
       [-rule string]  [-dense  double]  [-steps  integer]
       [-seed   integer]   [-inv]  [-mag  integer]  [-term
       string]

Simulates and plots a population of generalized virtual ants (vants). The behavior of the vants is determined by a bit string with length equal to the number of states that each cell in the vants' grid world can take. If a vant walks on a cell in state s, then the vant turns right if the s'th bit of the rule string is 1 and left if it is 0. As it leaves the cell the vant changes the state of the old cell to (s + 1) modulo the number of states.

Simulate and plot a population of virtual ants (vants). The behavior of the vants is determined by a bit string with length equal to the number of states that each cell in the vants' grid world can take. If a vant walks on a cell in state S, then the vant turns right if the S'th bit of the rule string is 1 and left if it's 0. As it leaves the cell the vant changes the state of the old cell to (S + 1) % NUMSTATES.

Miscellany

It is definitely worthwhile to simulate multiple vants as the possible composite behavior of multiple vants is far

different than a single vant. In fact, multiple vants can invert the work of other vants, which yields interesting deconstructive behavior.

Bugs

No sanity checks are performed to make sure that any of the options make sense.

Options

-widthWidth of the plot in pixels.200
-heightHeight of the plot in pixels.200
-numNumber of ants.1
-ruleRule string.10
-denseDensity of random crud.0.0
-stepsNumber of simulated steps.100000000
-seedRandom seed for initial state.0
-invInvert all colors?False
-magMagnification factor.1
-termHow to plot points.None

vants.c on GitHub