美文网首页
Processing 特训(Cellular automatio

Processing 特训(Cellular automatio

作者: 求愚 | 来源:发表于2019-08-11 12:24 被阅读0次

明确概念

Cellular automation: St = f(St-1),下一代由上一代进化而来

Integer.parseInt(str, 2):把字符串转化成2进制整数

明确功能

1.通过细胞进化的自动算法画一个CA

功能设计

类:Cell

属性:rules, round, cells

方法:automation(), draw()

伪代码

setup(){

}

draw(){

    cell.draw();

}

class Cell{

    定义属性

    Cell(){}

    定义方法

}

正式代码

见:

Processing/Autonomous_agent at master · JoeyQiang/Processing · GitHub

代码优化

1.通过数组顺序直接换算出其变化规律

相关文章

网友评论

      本文标题:Processing 特训(Cellular automatio

      本文链接:https://www.haomeiwen.com/subject/fufyrctx.html