1) Fill the array with values 0/1 with probability 0.5.
2)
Loop over entire array, calculate the sum from the 8 neighbors (plus
the given node) and change the value according to the rule:
sum = 0 1 2 3 4 5 6 7 8 9
new value = 0 0 0 0 1 0 1 1 1
3)
Apply the ping-pong rule, that is, for two buffers in which we keep the
data A and B and creating new values we write into the second one so as
not to overwrite those from which we are to draw data in a given
iteration. Then we replace A with B and so on over and over again.
No comments:
Post a Comment