eagleeye87

Posted
2 January 2007 @ 12pm

Tagged
Cocoa, Research

Cellular Automaton

Two years ago I worked on an interesting research project with a friend. In this project we examined a certain cellular automaton named Langton's Ants. Cellular automata are infinite grid spaces in which each space possesses a certain state. Spaces in Langton's Ants have one of two states, on or off. In this cellular automata, an "ant" traverses the infinite grid space. Each time the ant enters a square it follows a certain set of rules:

  1. If the square is 'on' the ant rotates 90 degrees clockwise and then moves forward one square.
  2. If the square is 'off' the ant rotates 90 degrees counterclockwise and then moves forward one square.
  3. When the ant leaves a square it switches the status.

Although these rules seem simple, the patterns produced are intriguing. Because of this, I decided to adapt some of the code written for the research project into a screen saver for Mac OS X. The screen saver randomly creates anywhere from 1 to 5 ants on a grid and then performs the simple rules for each ant. The following image is a pattern created by a single "ant."

cellularautomaton_1.png

Screen Saver
I am releasing the CellularAutomaton v1.0 screen saver today. I have only tested this on Mac OS X 10.4.8 on Intel and PowerPC computers. Because of this I do not know whether this will work on any version of Mac OS X below 10.4.8 (including 10.3.x and below). I hope you enjoy watching the amazing display as much as I enjoyed researching the automaton.

Click here to Download

Installation
To use the screen saver simply double-click the CellularAutomaton.saver file. Follow the directions and then navigate to the CellularAutomaton screen saver in the list of screen savers.

Images If you ever wish to save a pattern that appears on your screen simply press the s key. Once you hear a beep, a file starting with CellularAutomaton has been saved to your Desktop.

Note: Because of this feature the s key will not stop the screen saver.

I am interested to see all of the interesting images so feel free to email them to me. I hope to create a gallery of user-submitted images.

Options

cellularautomatonoptions.png

As shown above, there are few preferences which allow you to change the display behavior of the screen saver.

Questions?
If you do have any questions or run into any problems either leave a comment on this post or email me.

Further Reading
If you are interested in cellular automata or specifically Langton's Ants I suggest you explore the following links:

Langton's Ants at Mathworld
Cellular automata at Mathworld


iChat File Transfer Analysis