Newsgroups: comp.ai.alife
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!purdue!lerc.nasa.gov!magnus.acs.ohio-state.edu!math.ohio-state.edu!uwm.edu!chi-news.cic.net!newsfeed.internetmci.com!EU.net!uknet!newsfeed.ed.ac.uk!ainews!timothyh
From: timothyh@aisb.ed.ac.uk (Timothy Hely)
Subject: Asynchronous/Random Updating of Cells
Message-ID: <DGBwIK.Etp@aisb.ed.ac.uk>
Sender: news@aisb.ed.ac.uk (Network News Administrator)
Organization: Dept AI, Edinburgh University, Scotland
X-Newsreader: TIN [version 1.2 PL2]
Date: Thu, 12 Oct 1995 09:18:19 GMT
Lines: 41

Could anyone tell me whether there is a "standard" technique/algorithm
for updating a grid of N cells randomly, so that each cell is updated
once only before moving on to the next time step.

(Preferably something that could be translated into a C function)

The synchronous method would just start at 0 and loop until the (N-1)th
cell is reached. However I have the vague inkling that this can
introduce nasty side-effects which random updating might avoid.
(I am working with a 2d grid, but the problem is effectively 1d).

I imagine that random updating could be done as follows.

/* random.c */

(1) Create a linked list of size N where each link stores the number of
a cell and a pointer to the next link. Each link is allocated memory
individually.

(2) for(loop=0; loop<N ; loop++)
    {
      (3) Choose a random number R between 0 and (N-loop);

      (4) Update the cell corresponding to link(R).

      (5) Free/delete this link so that now only (N-loop-1) links
remain. Update the pointer of the previous link.

    }

This might involve a large amount of memory allocation, although each
cell would only need the random number generator to be called once.

Any comments/improvements on this method and its efficiency (or lack of
it) would be greatly appreciated. 

	Tim Hely.

(I will post a summary of any cunning methods to the group.)


