If you want to use an OO approach: try thinking of a sparse array of objects (previous and current generations) where each object "knows" its coordinates by being linked into a sparse array data structure.

Quoting gutti <philipp.guttenb...@gmx.net>:


On Fri, 14 Jan 2011 12:36:22 -0800 (PST)
"Wolfgang Jeltsch-2 [via Haskell]"
<ml-node+3341886-976283800-146...@n5.nabble.com> wrote:

Is this really ideal for OO? I thought that in a cellular automaton,
all cells have to change synchronously. In addition, cells have to
access the old states of their neighbours to compute their new
states. So you would have to heavily synchronize the objects.

In this light, I?d say that the distributed OO approach isn?t very
practical. A global control of the whole system might be better.

Note that I?m by no way an expert in cellular automata. I?m just
thinking of the game of life. :-)

Best wishes,
Wolfgang

Hi Wolfgang,

I don't yet have experience with cellular automata either. What u say
seems plausible, but then the life game might have been coded that way,
because most OO language don't offer concurrent objects and the
distributed OO approach (seems to be a very recent concept).

Looking at life u probably could save time, if u only would evaluate
code on cells, where the neighbors have changed status. So rather than
triggering them all centrally and each checks its neighbours, we could
use the concept:

- let the active ones trigger the neighbours & so pass on activity





_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to