MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

weighting CA neighbors by distance

  • To: mathgroup at smc.vnet.net
  • Subject: [mg29866] weighting CA neighbors by distance
  • From: Brent Pedersen <bpederse at nature.berkeley.edu>
  • Date: Sat, 14 Jul 2001 01:36:57 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

I am doing some variations of cellular automata.
Using only the actual value of the neighbors in determining the value of
the current cell, I can use:

Apply[Plus, Map[RotateRight[mat1, ##] &, nbrs]];

where mat1 is the matrix of values for whatever the CA is modelling.
and nbrs is a list of pairs (eg.
{{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},
{1,1}} for the 8 cell moore neighborhood.)  defining the neighborhood I
am interested in.

The line above sums all neighbors as they are but, I wish to weight the
neighbors
according to their distance (eg. {-1,-1} is farther away than {-1,0}
when using the
RotateRight function.
I think I may be able to do this with ListConvolve, or Inner but I can't
figure it out.
Anyone have any ideas?



  • Prev by Date: Memory Conservation
  • Next by Date: Re: OPTICA and GRIN media
  • Previous by thread: Re: Memory Conservation
  • Next by thread: Re: weighting CA neighbors by distance