细胞自动机实施

时间:2011-03-16 12:11:00

标签: c# cellular-automata

有人知道如何在Java或C#中实现细胞自动机吗?

2 个答案:

答案 0 :(得分:2)

我编写了一个可用于编写.NET实现的伪代码实现:

function automate(cells,bornlist,survivelist,iterations)
{
    loop(iterations)
    {
        loop(row < height)
        {
            loop(collumn < width)
            {
                if(is edge)
                {
                    alive = true
                }
                else
                {
                    num = add states of all cells around the outside (if in 3d     include above and below and use less iterations)
                    state = cells[row,collumn]
                    alive = (state = 0 and bornlist.contains(num)) or (state = 1     and survivelist.contains(num))
                }

                cells[row,collumn] = alive ? 1 : 0
            }
        }
    }
}

这取决于细胞已经用随机值初始化的事实 通过噪声发生器,如Simplex或Perlin噪声。

答案 1 :(得分:1)

我们需要更多信息,例如,您遇到的问题,困难等。与此同时, 这里有一些链接可以帮助您:

http://www.primaryobjects.com/CMS/Article106.aspx

http://cplus.about.com/b/2008/08/17/programming-challenge-17-implement-the-cellular-automaton-known-as-life.htm

https://web.archive.org/web/20110503020104/http://www.kim-team.com/blog/2009/06/cellular-automaton-in-net/

编辑:感谢Halil,我已经编辑了包含web.archive.org链接的答案。

相关问题