Browse

Langton's Ant 3D, Version 1 · Thu Oct 2, 09:04 AM

My first attempt at moving Langton’s Ant into a 3D grid. The 3D part was easy – just add some Z movement to the existing X and Y pattern.

This is what you are looking at: there are 100 cells in the X (left and right) and Y (up and down) plane, and 25 in the Z (toward and away from the viewer) plane. There is one bitmap for each Z level, making for 25 stacked bitmaps. The bitmap in which the ant is currently moving is set at 100% opacity, with the surrounding bitmaps becoming increasingly opaque until they are almost transparent. When the experiment seems to flicker, it is because the ant is rapidly switching between Z levels. Those long horizontal “roads” the ant makes are probably more like tubes when viewed in 3D space.

Making the ant move in an interesting pattern is a little more difficult. In 2D (X,Y) space, from each point the ant can either turn left or right, and move forward one space, depending on the state of the cell to which the ant moves. That means, using initial conditions, the ant will move in a perfect square: up 1, left 1, down 1, right 1, and end up back at the original square. In order for me to make that work in 3D space, the ant must visit each of eight cells, forming a cube, and return to the original cell without doubling back on itself. The current experiment does not do that, thus the long horizontal runs.

Right now there are 18 rules for the ant’s movements. Each of these rules is iterated through, based on the color of the cell on which the ant lands. Landing on an “off” cell causes the ant to move according to the next rule. Landing on an “on” cell causes the ant to move according to the previous rule. If I implement multiple “on” colors, then I can cut the movement rules down to 6, but I will need to have each rule account for the color of the cell in which the ant currently resides.

Look for more iterations on this problem in days to come.

  1. I have study this kind of ant, and developed some theory about it. My last paper talk about this, I can sent it you if you think it interesting. The rules are probably different from the yours.

    Beautiful simulations!


    Anahi Gajardo    Thu Oct 2, 07:57 PM    #
  2. Hi Anahi

    Thank you for the kind words! I am always happy to discover that someone is looking at my experiments. I am certainly interested in reading your paper, if you would like to send along a link to it. I have just updated my experiment and included a link to the latest source code. Or you can just find the code here:
    http://www.eccesignum.org/flash/ant/081003/LangtonsAnt.as.

    Again, thank you for visiting!


    John Winkelman    Fri Oct 3, 11:13 AM    #

::