Fun Stuff · Graphics · Silverlight · Uncategorized

Cellular Automata

Cellular Automata


http://paul.ennemoser.com/files/CellularAutomata.zip


A cellular automata consists of a grid of cells, with each cell having a number of states. The cells of the simple automata, that I’ve implemented in Silverlight, can have one of two states: On (Black) or Off (White).

Each row in the grid represents one generation (in this automata).
The state of a row depends on the state of the previous row, and so on.

A simple rule is used to generate the state of each cell of a row:
For each entry in the row we take the (N – 1th, Nth, N + 1th) cell triple
in the previous row.

Now we take this triple and use a lookup table to get the state of the entry.
Here are the lookup tables for two of the most famous patterns:

Rule 30 cellular automaton lookup table:

current pattern 111 110 101 100 011 010 001 000
new state for center cell 0 0 0 1 1 1 1 0

 

Rule 110 cellular automaton lookup table:

current pattern 111 110 101 100 011 010 001 000
new state for center cell 0 1 1 0 1 1 1 0

See the Wikipedia entry for more information.

Advertisements

3 thoughts on “Cellular Automata

  1. Hey, i was impressed by your Cellular Automata. I’m a student from Mexico, and recently i’ve been trying to implement one in WPF. However i have some issues with performance. I was wondering if you could help me.

    Thanks in advance.

    Mario

  2. Hello there Mario!
    What is your bottleneck?

    Graphics:
    In Silverlight I simply created NxM Rectangles in a Grid and changed their Fill property. This should work just fine in WPF.

    Reusing existing data structures:
    Be sure that you’re re-using your existing cellular field array.

    I could post the Source Code to the Game of Life and the Cellular Automata, if you want.
    Tick/Tiv/Paul

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s