[Numpy-discussion] Cellular Automata Neighborhoods & Numpy

Robert Cimrman cimrman3 at ntc.zcu.cz
Sun Mar 20 04:12:11 EDT 2011


Hi Michael,

You can find the full game of life script at [1].
There is also Belousov-Zhabotinsky cellular automaton. Both have a strided version.

r.

[1] http://docs.sfepy.org/scientific-python-tutorial/examples

----- Reply message -----
From: "Michael Mersky" <me at mydis.org>
To: <numpy-discussion at scipy.org>
Subject: [Numpy-discussion] Cellular Automata Neighborhoods & Numpy
Date: Sun, Mar 20, 2011 03:35
Hello, I stumbled upon this group tonight (http://mail.scipy.org/pipermail/numpy-discussion/2010-October/053420.html) while searching Google for examples of Cellular Automata(CA) using Numpy. The "Game of Life Strides" example looks great, but I don't fully comprehend how this example is working:


http://scipy.org/Cookbook/GameOfLifeStrides

If I have:

>>> world=arange(9).reshape(3,3)
>>> world
array([[0, 1, 2],
         [3, 4, 5],

         [6, 7, 8]])

how could I as_strided(world,shape?,strides) such that my 9 cell neighborhood at [0][0]

would be something like this (i.e. wrapped):

array([[8,6,7],
         [2,0,1],
         [5,3,4]])


Greatly appreciate your help!

-m
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20110320/4fcf8852/attachment.html>


More information about the NumPy-Discussion mailing list