Simple way of connecting cellular automata?

P

Pleg

Hi, I'm writing a little test program for an array of 64 cellular automata
for generating random numbers. The CA I've chosen has a connectivity of
{-7,0,11,17} with cyclic boundary conditions, that is, for example, the cell
number 20 has as input the outputs of cells {13,20,31,37}, and cell number
60 {53,60,7,13} (and so on for every cell). I'd rather not connect every
cell by hand, it'll be terribly tedious and easy to make mistakes
(expecially considering that this is just a test, and the real machine will
have 144 CA...)
So, is there an easy and automatic way of doing these connections?
In the test I wrote in C, the code was simply

for(j=0;j<L;j++){m_next[j]=rule50745(m[modulo(j-7)],m[j],m[modulo(j+11)],m[m
odulo(j+17)]);}

where "rule50745" is the rule for the next state and "modulo" is just

int modulo(int num){
int out=num;
if(num<0){out=num+L;}
else if(num>=L){out=num-L;}
return out;}


Any idea? Thx,


Pleg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top