How To Use The JavaScript Cyclic Cellular Automata Pattern Generator. 11/11/2005.
By Doug Clark.
CONTENTS:
-
What Are Cyclic Cellular Automata
-
How To Use The Pattern Generator.
-
Copying The Images.
-
References.
LINKS TO DOUG'S WEBSITE:
1. What Are Cyclic Cellular Automata?
The aim of writing the JavaScript Cyclic Cellular Automata Pattern Generator was to explore what
could be achieved using JavaScript and XHTML without the use of Applets.
-
The cyclic cellular automata realised in this display comprise a two dimensional, rectangular array of cells.
-
Each cell can exist in a number of states corresponding to different colours. The colour states are arranged cyclically.
At each update of the array each cell will advance to the next colour, only if the number of neighbourhood cells
in that colour exceeds a threshold value.
-
The neighbourhood is defined as a particular type (diamond or square) and by its size (the range).
-
In a diamond neighbourhood (also known as a Von Neumann neighbourhood) the cells are connected by their sides.
-
In a square neighbourhood (also known as a Moore neighbourhood) the cells are connected by their sides and
by their corners.
-
For both types of neighbourhoods, range is defined as number of cells transversed in the shortest route
from the central cell to the most distant peripheral cell.
At time zero the cells are assigned colours randomly, as the array is updated regular patterns may emerge according to
choice of parameters (e.g. number of colours, neighbourhood type and range, threshold) and update rules.
top
2. How To Use The Pattern Generator.
The Pattern Generator is used by setting parameters and pressing the 'Go' button. The 'Halt' button will stop the evolution of the
array, and the 'Continue' button will allow it to proceed.
-
The palette allows selection of the number of colours and the sequence of colours in the cycle. By clicking on
the individual cells of the palette, colours can be selcted from a larger pallete of 216 colours.
If less than twenty four colours are desired, select the option 'last' after the final colour.
-
The check boxes determine the update rules for individual colours.
-
If checked, the colour will advance automatically regardless of the colours of cells in their neighbourhood.
-
If not checked, the colour will only advance if the number of neighbourhood cells with the next colour exceeds the threshold.
-
The neighbourhood may be set as diamond or square.
-
The range may be set as 1, 2, or 3.
-
The threshold may be set from 1 to 27.
-
The boundaries of the array may be set in three different ways:
-
Unbounded - the array is 'wrapped around' so opposite edges join to form a continuous surface.
-
Inert - the array simply stops at the edges.
-
Mirrored - the layer of 3 cells adjacent to the edge is reflected.
-
The 'Greenberg-Hastings model' button sets the palette so that all the colours are checked except one. This
set of update rules is called the Greenberg-Hastings Model and leads to the evolution of characteristic spiral patterns.
The checks can be cleared with the 'Clear Check Boxes' button.
top
3. Copying The Images.
The patterns which develope on the generator can be converted to image files. The ease with which this
may be done will depend upon the computer and operating system. I have found the following procedure usable
(with a bit of trial and error):
-
Halt the Pattern Generator and copy a portion of the image to the clipboard. Use the marks on the sides
of the image to locate the portion to copy.
-
Open a Microft Word document and paste to the document.
-
Repeat Step 1, copying and pasting successive portions of the image.
-
When all the image has been pasted, select all and alter the font to Times New Roman and the size to 3 pt.
This should remove any 'gaps' between the rows in the array.
-
Copy the image and paste to Paint.
-
Adjust the size of the image to remove unused space and save as an image file.
top
4) References.
top