1

I am trying to implement some kind of artificial life simulation with cells propagating molecule concentration between them using an 2d cellular automata.

problem is that I cannot figure out an algorithm for these diffusion processes. I first thought, "ok Minecraft did something like that with their redstone stuff it can't be this hard"..

My implementation currently iterates over 2d array of cells where each cell has a number of molecules count. then I use kind of convolution with 3x3 kernel to propagate values if saturation of cells are not fulfilled.

For example start values like this:

100, 0, 0
  0, 0, 0
  0, 0, 0

leads to this configuration:

96,  1, 1
  1, 1, 0
  0, 0, 0

how can the cells in the middle "know" that they must propagate further although they are already saturated?

or may is simulating diffusion just not possible that way?

The simulation does not need to be physically correct. What only matters is that the molecules will distribute more or less evenly among the cells, the total number of molecules should not change in that process. Small rounding losses are acceptable.

pppery
  • 3,731
  • 22
  • 33
  • 46
codymanix
  • 28,510
  • 21
  • 92
  • 151

0 Answers0