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?