EdgeOfChaosCA

Version 2, June 2004

Note: The original EdgeOfChaosCA was written several years ago. This new version makes use of some features that have been added to the Java programming language since that time, most significantly the ability to save images such as this one. (Image saving is available only when the program is run as an application, not when you run the applet on this page. See the bottom of this page to download the application.) However, this new version will not work with older versions of Java. If this version does not work in your Web browser, see Version 1 (September 2006: Version 2.01 fixes the fact that the image didn't scroll properly on Mac OS.)


The EdgeOfChaosCA applet creates randomly-generated one-dimensional cellular automata and lets you see them in action. You can adjust a so-called "Lambda" parameter to try to find the "edge of chaos" where the most interesting things are supposed to happen. If you don't know what this means, you can read a page of information about cellular automata and another page about the Edge of Chaos.

To open the EdgeOfChaosCA in a separate window, click this button:

(Might require two clicks on Windows.)

(If this doesn't work, try Version 1).

Instructions: A cellular automaton is a one-dimensional "world," shown as a row of colored squares. The world evolves over time through a sequence of generations, following the rules that define the automaton. By drawing each generation under the previous generation, you get a two-dimensional image. This is the type of image that is shown in the EdgeOfChaosCA window. The exact image that you get depends on the exact rules of the automaton. Five sample rule sets are available in the EdgeOfChaosCA "Examples" menu. Just select one of the examples, and watch what happens. Note that the size of the cellular automaton world can be bigger than the width of the window. In that case, a scroll bar appears at the bottom of the window, and you can use this scroll bar to view the whole world.

The slider at the top of the window is used to adjust the "Lambda" parameter of the cellular automaton. One of the states of the automaton---state number 0, represented by the color white by default---is said to be "dead." Every other state is considered to be "alive." The Lambda parameter is simply the fraction of all the rules that lead to "alive" states. When Lambda is small, most rules lead to "death," and all the cells tend to die off quickly. When Lambda is large, most rules lead to "life," but the result tends to be "chaos," a meaningless jumble of color. The nicest-looking pictures are supposed to occur somewhere between these two extremes, on the "edge of chaos." The main point of the applet is to adjust the Lambda slider to see whether you can observe the edge. In the process, you can make some pretty pictures. (Note: When you adjust the Lambda value, the world is restarted from generation 0, using the same initial world.)

The first command in the "Control" menu allows you to pause and resume the production of new generations of the automaton. When the action is paused, the second command in this menu lets you produce one generation at a time. The following five commands in the "Control" menu control the speed at which new generations are produced.

The next five commands in the "Control" menu are for restarting the world from generation zero. The "Start World Again" command will restart using the same world that produced the current image. This will re-play exactly the same sequence of generations. The "First Image then Stop" does what it says: It runs starting from generation zero until one full image has been produced, then stops. (The number of generations in a full image is specified when the world is first created.) The "New Random World" command creates a new world by setting each cell in the world to a randomly selected state, and uses that world as the starting generation. The "New Random Clump" creates a world in which the middle 51 cells are set to random values, and the remaining cells are set to be dead. The "Single Dot Start" command starts with a world in which the middle cell is set to state 1 and all the other cells are dead. (This world tends to die off quickly, unless Lambda is fairly large.)

The final command in the "Control" menu is "Colors." This command opens a dialog box that you can use to set the colors that are used to represent the different possible states that a cell can be in. Several pre-set palettes of colors are available, and you can set an individual color by clicking on it. Note that color number 0 is the color of the "dead" state.

The "File" menu has two commands that can be used to create new cellular automata. The rules for an automaton are generated randomly, but based on certain parameters that you can set. The "New" command opens a dialog box where you can set the parameters that will be used to create the new automaton. The "New with Same Settings" command creates a new world using the same parameters as the the current world. The parameters that you can set in the "New" dialog are as follows (the first two are the most important):


Application Version: Because of security restrictions on applets, the applet on this page cannot access files. The application version of the program can save image files. It can also save the data for a cellular automaton in a file, which can be opened again later. In the application version, the "File" menu contains commands for saving the current image and for saving and opening files.

To run the application version, download the following file:

EdgeOfChaosCA.jar

This file is an executable jar file. On Windows and MacOS X, you should be able to run it simply by double-clicking on the file icon (assuming that you have Java 1.4 or later installed). It can also be run on the command line with the command "java -jar EdgeOfChaosCA.jar".

The source code for this program is available for on-line browsing:

EdgeOfChaosCA source code

You can also download the source code as a ZIP archive:

EdgeOfChaosCA_source.zip

This ZIP archive includes the five examples that are available in the applet on this page. These are simply files that were saved from the program, and you can open them in the program using the "Open" command.

[Index] [Previous] [Next] [HandCraftCA Applet] [Eck's Java Page]


David J. Eck
Department of Mathematics and Computer Science
Hobart and William Smith Colleges
Geneva, NY 14456
E-mail: eck@hws.edu