Generative Algorithms: Cellular Automata (CA)

A cellular automaton consists of a regular grid of cells, each in one of a finite number of states, "On" and "Off" for example. The grid can be in any finite number of dimensions. For each cell, a set of cells called its neighborhood (usually including the cell itself) is defined relative to the specified cell. For example, the neighborhood of a cell might be defined as the set of cells a distance of 2 or less from the cell. An initial state (time t=0) is selected by assigning a state for each cell. A new generation is created (advancing t by 1), according to some fixed rule (generally, a mathematical function) that determines the new state of each cell in terms of the current state of the cell and the states of the cells in its neighborhood.
Check wikipedia for full details and examples.

Conway Game of Life Implemented in Grasshopper and RhinoScript

 

Downloads:

CA_GameOfLife.gh

  • Rajaa Issa

    Attached is a revised version of the Game of Life in grasshopper.  It fixes a bug where the new state is saved on top of the old state and it causes following cells to be incorrectly evaluated.  thanks to Leming for pointing this out.

  • KF LOK

    hello, i am new to the vbscript.

    i had a question about the revised script, because i'm trying to modified the script you upload to fit my rules(http://www.grasshopper3d.com/forum/topics/vb-code-problem)

    but i figure out that the result point with start to became blank every YNum that i set

    example: if my YNum set to 25

    then the result of the point will start become blank for 14 points after the 25th point in the grid, and repeating the pattern. 

  • KF LOK

    is it the problem of the original script you wrote? or it is the problem after i modified it.

    thank you

  • Nezumi

    hello , Rajaa Issa, i found some question about your CA script .

    How does it create rows ? Why is the yNum must be smaller than xNum? 

    and i feel it should go like this.

    'Create rows
    For i = 0 To State.Count() - 1 Step xNum
    y = 0
    For j = i To i + xNum - 1
    Dim st As Integer
    st = State(j)
    SGrid(x, y) = st
    y = y + 1
    Next
    x = x + 1
    Next