HOME | DD

javamocha — 2D Cellular Automata

Published: 2009-01-04 18:36:17 +0000 UTC; Views: 186; Favourites: 1; Downloads: 2
Redirect to original
Description A program submitted for a scholarship.

Download
it is an .exe though so many computers might not like it.

This is a program I made a while back.

I learned about cellular automata from the book A NEW KIND OF SCIENCE by Stephen Wolfram. I made a program to reproduce the phenomena I saw in this book. Wolfram focused on many forms of automata including the 2 dimensional type I demonstrate here.

The program works by creating a 3 dimensional array which is filled slice by slice according to the previous state. Each cell's value is determined by the sum of the number of blacks in the layer above it. There are two versions of this process that can be examined with this program. The first is simpler and only looks at the four cells that would be directly adjacent to it on the previous layer of the array. The second mode looks at the cells all eight surrounding cells in the previous layer. This mean that a disturbance such as an initial black cell on the first layer propagates out in each successive layers to form many interesting patterns depending on which rule is used.

The rule set's that govern these phenomena are represented in to ways on the window. The list in the frame labeled Rule Set displays a truth table which governs the calculation of each automata. This can be changed easily by selecting the selecting a start value, either checked or unchecked, a sum of the surrounding cells in the previous layer and what ever state you want that cell to have when that condition is met.

Each rule set can be represented as a number that is derived using each possible state's end value, either 1 or 0 as a digit in a binary number which is covered to decimal to act as a naming system. For ease of use I have provided a Random button to choose a random code to run from. To use a code number, click the Use Code button.

The program is designed to get inputs in a certain order.

The system: either four or eight discussed above

The cross section axis: this chooses which cross section to display. Y for horizontal (or step by step) and Z for vertical.

The number of steps: this is incredibly important because it determines the size of automata calculated. I recommend staying around 40 but because it slows down rapidly beyond that.

Then you can type in a code (between 0 and 1023 for system four and between 0 and 262143 for system eight) or hit Random. Then hit Use Code.

Then you can hit the big Run button.

You can explore you creation by using the scroll bar on the right, typing in a step number between 1 and the number of steps calculated for, or, if you are in the Y cross section, hit the Cycle button on the lower left to watch the program scroll though the layers.

You can save images of your creation by creating a file named 2D Cellular and placing it on you desktop. The program should save a .bmp of the image in the window to the file.

While in the Y cross section you can look at your creation in 2 other ways. Point Density which looks down though each column and gives the average color for each column in the array and first black which is colored according to how far down the Z axis in the first black cell is in a column.

Well that's about it. I hope you enjoy my program.
Related content
Comments: 2

ShnitzelKiller [2009-05-18 00:26:07 +0000 UTC]

I have that book! Too bad I have a mac, though, this looks cool, and there don't seem to be many simulators for these things. I made one in flash, but it's the row-by-row kind.

👍: 0 ⏩: 1

javamocha In reply to ShnitzelKiller [2009-05-18 22:06:30 +0000 UTC]

i was really just messing around with this

thanks for ur interest

👍: 0 ⏩: 0