Re: [livecode] [OT] cellular automata

From: Kassen <signal.automatique_at_gmail.com>
Date: Tue, 16 Sep 2008 12:49:16 +0200

AlgoMantra;

>
>>
> The trouble is the "looping over the array", and especially on which cell
> should it start. To add to the confusion, it's a ringed array. In my vision
> of things, all cells start simultaneously. There are no loops except within
> the cells own structure.
>
>
Actually, with the method I suggested it does *not* matter where you start.
Every time you want your CA to update you'll need to calculate a new value
for every cell and after all new values have been calculated you update them
to expressing this new state in one swoop. You could do this in any order
you please.



> If you'd like to get clever you could call the two variables "state A" and
>> "state B" and instead of the second loop simply swap which one of the two
>> refers to the current state and which one is the temporary holder for
>> already calculated results, that would save some CPU.
>>
>
> I'm totally confused by that, can you explain more simply?
>
>

I hope so :¬)

If I understand the original question correctly your problem is that you
don't want the order in which you calculate your new values to matter; you
fear that you'll start at cell1, that it will change from white to black and
that this will affect cell2 when you calculate the new value for cell2,
right?

My first suggestion was to make every cell hold two values. First of all it
clearly needs to hold a value for the state it's in now, say a 1 or a 0 to
indicate white or black. I'm suggesting you also make it hold a *second*
value (also a 1 or 0) that indicates the state it's going to have in the
next generation once we finish calculating that generation (so once we have
gone over all the cells).

So; we'd start at cell1, which is -say- white right now. We calculate that
it will be black in the next round so we store that in the second value,
leaving it's current state be for now. We then move on to cell2 and base the
calculations for cell2 on cell1 still being white as that's what it's state
still says right now; never touched that so far. We store the outcome of
this in cell2's second value, leaving cell2's current state intact as well.

Once we have done this for all cells we have a series of cells that still
holds the same state it had when we started but every cell now also holds
-in it's second value- the state it should have in the new generation. At
this point we can swap the meaning of the two values. We simply define that
now the "second value" defines their "state" and at that moment we instantly
have a updated CA that correctly holds it's new pattern without calculation
order having mattered.

I hope it's more clear now?



> That's not the issue actually. I've already done much of the homework.
> Google for a paper called "computational monadology". It's Leibniz's
> Monadologie re-written as cellular automata theory. I may have mailed you
> that before....no?
>
>
I meant to look for a efficient way of updating all cells. I think mine is
quite decent but perhaps somebody more clever came up with a optimisation.

Yours,
Kas.
Received on Tue Sep 16 2008 - 10:51:50 BST

This archive was generated by hypermail 2.4.0 : Sun Aug 20 2023 - 16:02:23 BST