CellularAutomaton[rule,init,t]
产生一个表示元胞自动机演化的列表,该元胞自动机指定的规则,其初始条件 init,共有 t 步.
CellularAutomaton[rule,init]
给出 init 演化一步的结果.
CellularAutomaton[rule,init,{tspec,xspec,…}]
仅给出由 tspec、xspec,等指定的演化部分.
CellularAutomaton[rule,init,{t,All,…}]
i在各步包括在 t 步中受影响的所有元胞.
CellularAutomaton[rule]
是 CellularAutomaton 的操作符形式,表示演化过程中的一步.
CellularAutomaton
CellularAutomaton[rule,init,t]
产生一个表示元胞自动机演化的列表,该元胞自动机指定的规则,其初始条件 init,共有 t 步.
CellularAutomaton[rule,init]
给出 init 演化一步的结果.
CellularAutomaton[rule,init,{tspec,xspec,…}]
仅给出由 tspec、xspec,等指定的演化部分.
CellularAutomaton[rule,init,{t,All,…}]
i在各步包括在 t 步中受影响的所有元胞.
CellularAutomaton[rule]
是 CellularAutomaton 的操作符形式,表示演化过程中的一步.
更多信息
- rule 的可能形式有:
-
n
,
,规则号为 n 的初等规则{n,k} 产生 k 色的最近邻规则 {n,k,r} 产生 k 色、范围为 r 的一般规则 {n,k,{r1,r2,…,rd}} 按
邻近的 d 维规则{n,k,{{off1},{off2},…,{offs}}} 指定偏移量的近邻规则 {n,k,rspec,s} s 阶规则 {n,{k,1}} k 色最近邻极权规则 {n,{k,1},r} k 色、范围为 r 的极权规则 {n,{k,{wt1,wt2,…}},rspec} 近邻 i 的权重被赋为 wti 的规则 {lhs1->rhs1,lhs2->rhs2,…} 近邻列表的明确替换 {fun,{},rspec} 应用于各个近邻列表的一般函数 fun bfun 应用于近邻集合的布尔函数 CellularAutomaton[rule] 规则的运算符形式 <|"key1"val1,"key2"val2,…|> 由关联给出的规范 "name" 已命名规则 - CellularAutomaton[{n,k},…] 等价于 CellularAutomaton[{n,{k,{k^2,k,1}}},…].
- 可以使用下面的键来指定以关联形式给出的规则:
-
"RuleNumber" n 规则编号 "TotalisticCode" n 极权代码 "OuterTotalisticCode" n 外部极权代码 "GrowthCases" {g1,g2,…} 当其邻域的 gi 为 1 时把元胞置 1 "GrowthSurvivalCases" {{g1,…},{s1,…}} 把 gi 邻域置 1;保持 si 不变 "GrowthDecayCases" {{g1,…},{d1,…}} 把 gi 邻域置 1;di 置 0 "Dimension" d 整体维度 "Colors" k 颜色的数量 "Range" r 规则范围 "Neighborhood" type 邻域类型 - 当设置为 "GrowthCases"->{g1,g2,…} 时,如果一个元胞有 gi 个邻域为 1 时,它的值从 0 变为 1;否则它的值不变.
- 当设置为 "GrowthSurvivalCases"->{{g1,…},{s1,…}} 时,如果一个元胞有 gi 个邻域为 1 时,它的值从 0 变为 1,如果有 si 个邻域为 1 时,保持值为 1,否则值为 0.
- 当设置为 "GrowthDecayCases"->{{g1,…},{d1,…}} 时,如果一个元胞有 gi 个邻域为 1 时,它的值从 0 变为 1,如果有 di 个邻域为 1 时,值为 0 ,否则保持不变.
- 二维 "Neighborhood" 的可能设置包括:
-
5 或 "VonNeumann" CrossMatrix[1] 9 或 "Moore" BoxMatrix[1] - 对于维度 d,"Neighborhood" 支持 "VonNeumann" 和 "Moore",以及整数
和
. - 以 CellularAutomaton["name",…] 形式给出的可能的已命名的元胞自动机规则包括:
-
"Rule30" 30 "Rule90" 90 "Rule110" 110 "Code1599" {1599,{3,1}} "GameOfLife" {224,{2,{{2,2,2},{2,1,2},{2,2,2}}},{1,1}} - 常见的二维元胞自动机规则的明确形式包括:
-
{n,{k,1},{1,1}} 9 近邻极权规则 {n,{k,{{0,1,0},{1,1,1},{0,1,0}}},{1,1}} 5 近邻极权规则 {n,{k,{{0,k,0},{k,1,k},{0,k,0}}},{1,1}} 5 近邻外部极权规则 - 元胞自动机规则的可能数量如下:
-
基本规则 256 一维常规规则 
一维极权规则 
二维常规规则 
二维9近邻极权规则 
二维5近邻极权规则 
二维5近邻外部极权规则 
- 通常,init 中的所有元素在和演化列表是 0 和
间的整数. - 当使用一般函数或替换列表时, init 的元素和演化列表可以是任何表达式. »
- 明确替换规则 lhsi->rhsi 可以包括模式.
- 在一维元胞自动机中,替换规则或明确函数 fun 可以用于一维近邻列表. 若近邻指定明确偏移量,则它们按偏移量顺序给定.
- 当多维元胞自动机的近邻在指定范围内定义,例如 {r1,r2,…},则近邻列表采用 2{r1,r2,…}+1 维全数组.
- 若多维元胞自动机的近邻由显式偏移量列表指定,则近邻按指定顺序的偏移量的一维列表提供.
- 若给定明确函数 fun,则所提供的第一个自变量将是近邻列表,第二自变量是从 0 开始的步数.
- 如果 BooleanVariables[bfun] 产生一个整数 v,则完整的规则说明被认为是纯布尔函数 bfun. 在这种情况下,bfun 将在每一步应用于 v 元胞的近邻. 这个近邻将把 Ceiling[v/2] 个元胞扩展到左侧.
- 在由 {rule,kspec,rspec,s} 指定的 s 阶元胞自动机中,各步取决于之前的 s 步.
- 初始情况由 init 构造如下:
-
{a1,a2,…} 假定循环时,值 ai 的明确列表 {{a1,a2,…},b} 值 ai 叠加于背景 b 上 {{a1,a2,…},{b1,b2,…}} 值 ai 叠加于重复背景 b1、b2、… {{{{a11,a12,…},off1}, {{a21,…},off2},…},bspec} 值 aij 在背景的偏移量 offi {{a11,a12,…},{a21,…},…} 二维明确值列表 {aspec,bspec} d 维填充下的 d 维值 - aspec 的第一个元素被叠加的背景位于各个坐标正向相对原点的第一个坐标处. 也就是说,bspec[[1,1,…]] 与 aspec[[1,1,…]] 对齐.
- CellularAutomaton[rule,init,t] 生成长度为
的演化列表. - 对 s 阶元胞自动机,init 是给出演化系统中初始 s 步的一个列表.
- {tspec,xspec,…} 中的时间指定 tspec 如下:
-
t 0 到 t 的所有步 {t} 仅包含第 t 步的列表 {{t}} 仅第 t 步 {t1,t2} 第 t1 到 t2 步 {t1,t2,dt} 步 t1, t1+dt, … - 第 0 步作为初始条件.
- CellularAutomaton[rule,init,{tspec}] 的 xspec 使用缺省 Automatic.
- 空间指定 xspec 如下:
-
All 受指定的初始情况影响的所有元胞 Automatic 与背景不同的区域内的所有元胞 0 与 aspec 的开始对齐的元胞 x 向右的偏移量至多为 x 的元胞 -x 向左的偏移量至多为 x 的元胞 {x} 向右的偏移量为 x 的元胞 {-x} 向左的偏移量为 x 的元胞 {x1,x2} 偏移量为 x1 到 x2 的元胞 {x1,x2,dx} 元胞 x1, x1+dx, … - 一维时,aspec 的第一个元素在缺省的情况下有空间偏移量 0.
- 在任意维数时,aspec[[1,1,1,…]] 在缺省的情况下有空间偏移量 {0,0,0,…}.
- 由 CellularAutomaton 生成的演化列表的各个元素恒有相同的大小.
- 在由宽度为
的 aspec 指定的初始条件下,在
步后能够被范围为
的规则影响的的区域具有宽度
. - 若 bspec 背景不被指定,则 All 和 Automatic 的空间偏移量将包括 aspec 的每个元胞.
- All 的空间偏移量包括初始条件下所有受影响的元胞.
- Automatic 的空间偏移量可用于剪切元胞自动机模式各边的背景.
- 在确定区域的宽度时,Automatic 仅考虑由 offt 指定的各步的结果.
- CellularAutomaton[rule][init] 等价于 CellularAutomaton[rule,init].
范例
打开所有单元 关闭所有单元基本范例 (3)
范围 (91)
一维规则 (26)
CellularAutomaton[73, {{1}, 0}, 4]//GridArrayPlot[CellularAutomaton[73, {{1}, 0}, 50]]用 RulePlot 产生同样的结果:
RulePlot[CellularAutomaton[73], {{1}, 0}, 50]ArrayPlot[CellularAutomaton[{679458, 3}, {{1}, 0}, 50]]ArrayPlot[CellularAutomaton[{679458, 3}, {{1}, 0}, 50], ColorRules -> {1 -> Pink, 2 -> Blue}]RulePlot[CellularAutomaton[{679458, 3}], ColorRules -> {1 -> Pink, 2 -> Blue}]ArrayPlot[CellularAutomaton[{867, {3, 1}}, {{1}, 0}, 50]]ArrayPlot[CellularAutomaton[{23898, 2, 3 / 2}, {{1}, 0}, 40]]ArrayPlot[CellularAutomaton[{39421042, 2, 2}, {{1}, 0}, 40]]ArrayPlot[CellularAutomaton[{10, {2, 1}, 2}, {{1}, 0}, 40]]ArrayPlot[CellularAutomaton[{30, 2, {{-1}, {0}, {1}}}, {{1}, 0}, 50]]ArrayPlot[CellularAutomaton[{30, 2, {{-1}, {0}, {2}}}, {{1}, 0}, 50]]ArrayPlot[CellularAutomaton[{9, 2, {{-1}, {2}}}, {{1}, 0}, 50]]ArrayPlot[CellularAutomaton[{30, {2, {4, 2, 1}}}, {{1}, 0}, 50]]ArrayPlot[CellularAutomaton[{2049, {3, 1}}, {{1}, 0}, 50]]ArrayPlot[CellularAutomaton[{2049, {3, {1, 1, 1}}}, {{1}, 0}, 50]]ArrayPlot[CellularAutomaton[{50257, {3, {3, 1, 3}}}, {{1}, 0}, 50]]ArrayPlot[CellularAutomaton[{{1, _, 1} -> 0, {1, _, 0} -> 1, {0, _, 1} -> 1, {0, _, 0} -> 0}, {{1}, 0}, 50]]ArrayPlot[CellularAutomaton[{{x_, _, y_} :> Mod[x + y, 2]}, {{1}, 0}, 50]]对规则 30 使用明确布尔公式,在 True 和 False 状态下操作:
CellularAutomaton[{{p_, q_, r_} -> Xor[p, Or[q, r]]}, {{True}, False}, 2]ArrayPlot[Boole[%]]CellularAutomaton[{{a, _, b} -> a, {b, _, a} -> b, {x_, _, x_} -> a}, {{b}, a}, 4]CellularAutomaton[{f[#]&, {}, 1}, {a, b, c}, 1]CellularAutomaton[{f[#]&, {}, {{-1}, {0}}}, {{1}, 0}, 2]Grid[%]CellularAutomaton[{Total[#]&, {}, 1 / 2}, {{1}, 0}, 3]ArrayPlot[CellularAutomaton[{Mod[#[[1]] + #[[3]], 2]&, {}, 1}, {{1}, 0}, 50]]ArrayPlot[CellularAutomaton[{Mod[Total[#], 4]&, {}, 1}, {{1}, 0}, 50]]CellularAutomaton[{f[#1, #2]&, {}, 1}, {a, b, c}, 1]CellularAutomaton[{f, {}, 1}, {a, b, c}, 1]ArrayPlot[CellularAutomaton[{Mod[Total[#] + #2, 4]&, {}, 1}, {{1}, 0}, 30]]ArrayPlot[CellularAutomaton[{Mod[Total[#] / 2, 1]&, {}, 1}, {{1}, 0}, 50]]ArrayPlot[CellularAutomaton[{Mod[Total[#] / 2, 1]&, {}, 1}, {{1}, 0}, 50], ColorFunction -> Hue]ArrayPlot[CellularAutomaton[Xor[#1, #3]&, {{1}, 0}, 50]]ArrayPlot[CellularAutomaton[BooleanFunction[90, 3], {{1}, 0}, 50]]ArrayPlot[CellularAutomaton[Xor[#1, #5]&, {{1}, 0}, 50]]用关联指定的规则 (5)
ArrayPlot[CellularAutomaton[<|"RuleNumber" -> 30|>, {{1}, 0}, 30]]ArrayPlot[CellularAutomaton[<|"RuleNumber" -> 679458, "Colors" -> 3|>, {{1}, 0}, 40], ColorRules -> {1 -> Pink, 2 -> Blue}]ArrayPlot[CellularAutomaton[<|"RuleNumber" -> 23898, "Range" -> 3 / 2|>, {{1}, 0}, 40]]ArrayPlot[CellularAutomaton[<|"TotalisticCode" -> 867, "Colors" -> 3|>, {{1}, 0}, 50]]ArrayPlot[CellularAutomaton[<|"OuterTotalisticCode" -> 50257, "Colors" -> 3|>, {{1}, 0}, 50]]初始条件 (8)
CellularAutomaton[30, {1, 0, 0, 0, 0, 0}, 2]CellularAutomaton[30, {1, 0, 0, 0, 0, 0}, 2]//GridCellularAutomaton[{f[#]&, {}, 1}, {a, b, c, d}, 1]ArrayPlot[CellularAutomaton[30, RandomInteger[1, 100], 50]]ArrayPlot[CellularAutomaton[126, {{1, 1, 1, 0, 1}, 0}, 20]]ArrayPlot[CellularAutomaton[150, {{0}, 1}, 20]]ArrayPlot[CellularAutomaton[22, {{1, 1, 1}, {1, 0}}, 20]]ArrayPlot[CellularAutomaton[150, {SparseArray[{1 -> 1, 10 -> 1}], 0}, 20]]使用 SparseArray 给出完全的循环初始条件:
ArrayPlot[CellularAutomaton[150, SparseArray[{1 -> 1, 10 -> 1}, 50], 20]]ArrayPlot[CellularAutomaton[150, {{{{1, 0, 1}, {-8}}, {{1, 1}, {9}}}, 0}, 20]]时间步 (6)
CellularAutomaton[30, {{1}, 0}, 2]CellularAutomaton[30, {{1}, 0}, {2}]CellularAutomaton[30, {{1}, 0}, {{2}}]CellularAutomaton[30, {{1}, 0}, {{{2}}}]ArrayPlot[CellularAutomaton[30, {{1}, 0}, {{50, 80}}]]CellularAutomaton[30, {{1}, 0}, {{0, 2}}]ArrayPlot[CellularAutomaton[30, {{1}, 0}, {{0, 100, 3}}]]区域规范 (11)
缺省的情况下,CellularAutomaton 自动切除不被模式覆盖的区域:
ArrayPlot[CellularAutomaton[110, {{1}, 0}, 50]]ArrayPlot[CellularAutomaton[110, {{1}, 0}, {50, Automatic}]]ArrayPlot[CellularAutomaton[110, {{1}, 0}, {50, All}]]ArrayPlot[CellularAutomaton[45, {{1}, 0}, 50]]ArrayPlot[CellularAutomaton[45, {{1}, 0}, {50, All}]]Table[ArrayPlot[CellularAutomaton[n, {{1}, 0}, 40], ImageSize -> {Automatic, 60}], {n, 57, 60}]Table[ArrayPlot[CellularAutomaton[n, {{1}, 0}, {40, All}], ImageSize -> {Automatic, 60}], {n, 57, 60}]ArrayPlot[CellularAutomaton[{10008, 2, 3 / 2}, {{1}, 0}, {50, All}]]ArrayPlot[CellularAutomaton[30, {{1}, 0}, {50, {0, 40}}]]ArrayPlot[CellularAutomaton[30, {{1}, 0}, {50, {-20, 40}}]]CellularAutomaton[30, {{1}, 0}, {15, {0}}]CellularAutomaton[30, {{1}, 0}, {15, {{0}}}]ArrayPlot[CellularAutomaton[45, {{1}, 0}, {{0, 100, 2}, {-100, 100, 2}}]]ArrayPlot[CellularAutomaton[30, {{1, 1, 0, 1}, 0}, {10, {0, 15}}], Mesh -> True]ArrayPlot[CellularAutomaton[30, {1, 1, 0, 1, 0, 0, 1}, {30, {-40, 40}}]]多维规则 (13)
CellularAutomaton[{14, {2, 1}, {1, 1}}, {{{1}}, 0}, 2]CellularAutomaton[{14, {2, 1}, {1, 1}}, {{{1}}, 0}, {{{2}}}]ArrayPlot[CellularAutomaton[{14, {2, 1}, {1, 1}}, {{{1}}, 0}, {{{30}}}]]ArrayPlot[Mean[CellularAutomaton[{14, {2, 1}, {1, 1}}, {{{1}}, 0}, 30]]]ArrayPlot3D[CellularAutomaton[{14, {2, 1}, {1, 1}}, {{{1}}, 0}, 10]]Graphics3D[Cuboid /@ Position[CellularAutomaton[{14, {2, 1}, {1, 1}}, {{{1}}, 0}, 10], 1], ViewVertical -> {-1, 0, 0}]Graphics3D[{Opacity[.2], EdgeForm[], Cuboid /@ Position[CellularAutomaton[{14, {2, 1}, {1, 1}}, {{{1}}, 0}, 10], 1]}, ViewVertical -> {-1, 0, 0}]空间时间的 50 步切片将在
偏移量为 0 处横跨所有
的值:
ArrayPlot[CellularAutomaton[{14, {2, 1}, {1, 1}}, {{{1}}, 0}, {50, All, {{0}}}]]ArrayPlot[Mean /@ CellularAutomaton[{14, {2, 1}, {1, 1}}, {{{1}}, 0}, 30]]用 RulePlot 可视化极权规则规范:
RulePlot[CellularAutomaton[{14, {2, 1}, {1, 1}}]]ArrayPlot[CellularAutomaton[{26, {2, {{0, 1, 0}, {1, 1, 1}, {0, 1, 0}}}, {1, 1}}, {{{1}}, 0}, {{{100}}}]]ArrayPlot[CellularAutomaton[{110, {2, {{0, 2, 0}, {2, 1, 2}, {0, 2, 0}}}, {1, 1}}, {{{1}}, 0}, {{{100}}}]]用 RulePlot 可视化外部极权规则规范:
RulePlot[CellularAutomaton[{110, {2, {{0, 2, 0}, {2, 1, 2}, {0, 2, 0}}}, {1, 1}}]]ArrayPlot[CellularAutomaton[{110, {2, {{0, 2, 0}, {2, 1, 2}, {0, 2, 0}}}, {1, 1}}, {SparseArray[{{1, 1}, {1, 100}} -> 1], 0}, {{{100}}}]]ArrayPlot3D[CellularAutomaton[{14, {2, 1}, {1, 1, 1}}, {{{{1}}}, 0}, {{{10}}}]]用关联指定的多维规则 (8)
ArrayPlot[CellularAutomaton[<|"TotalisticCode" -> 14, "Dimension" -> 2|>, {{{1}}, 0}, {{{30}}}]]ArrayPlot[
CellularAutomaton[<|"TotalisticCode" -> 26, "Dimension" -> 2, "Neighborhood" -> 5|>, {{{1}}, 0}, {{{30}}}]]ArrayPlot[
CellularAutomaton[<|"TotalisticCode" -> 26, "Dimension" -> 2, "Neighborhood" -> "VonNeumann"|>, {{{1}}, 0}, {{{30}}}]]ArrayPlot[CellularAutomaton[<|"OuterTotalisticCode" -> 110, "Dimension" -> 2, "Neighborhood" -> 5|>, {{{1}}, 0}, {{{40}}}]](9 个邻域中)当元胞有 1 个或 2 个邻域的值为 1 时的生长规则:
ArrayPlot[CellularAutomaton[<|"Dimension" -> 2, "GrowthCases" -> {1, 2}|>, {{{1}}, 0}, {{{50}}}]]ArrayPlot3D[CellularAutomaton[<|"Dimension" -> 2, "GrowthCases" -> {1, 2}|>, {{{1}}, 0}, 50]]当元胞有 1 个或 2 个邻域的值为 1 时,元胞的值为 1,当元胞有 6 个或 7 个邻域的值为 1 时,元胞的值为 0 的生长衰灭规则:
ArrayPlot[CellularAutomaton[<|"Dimension" -> 2, "GrowthDecayCases" -> {{1, 2}, {6, 7}}|>, {{{1}}, 0}, {{{50}}}]]当元胞有 1 个或 2 个邻域的值为 1 时,元胞的值为 1,当元胞有 6 个或 7 个邻域的值为 1 时,元胞的值保持不变,否则值为 0 的规则:
ArrayPlot[CellularAutomaton[<|"Dimension" -> 2, "GrowthSurvivalCases" -> {{1, 2}, {6, 7}}|>, {{{1}}, 0}, {{{50}}}]](7 个邻域中)当元胞有 1 个邻域的值为 1 时,元胞的值为 1:
ArrayPlot3D[CellularAutomaton[
<|"GrowthCases" -> {1}, "Dimension" -> 3, "Neighborhood" -> 7|>, {{{{1}}}, 0}, {{{5}}}]](27 个邻域中)当元胞有 1 个邻域的值为 1 时,元胞的值为 1:
ArrayPlot3D[CellularAutomaton[
<|"GrowthCases" -> {1}, "Dimension" -> 3, "Neighborhood" -> 27|>, {{{{1}}}, 0}, {{{6}}}]]高阶规则 (6)
CellularAutomaton[{30, 2, 1, 1}, {{1, 0, 1, 1}}, 4]CellularAutomaton[{30, 2, 1, 2}, {{1, 0, 1, 1}, {1, 1, 0, 1}}, 4]CellularAutomaton[{30, 2, 1, 2}, {{1, 0, 1, 1}, {1, 1, 0, 1}}, {{-1, 4}}]ArrayPlot[CellularAutomaton[{1008, 2, 1, 2}, {{{1}, {1}}, 0}, 40]]ArrayPlot[CellularAutomaton[{1008, 2, 1, 2}, {{{1}, {1}}, 0}, {{-1, 10}}]]ArrayPlot[CellularAutomaton[{10, {2, 1}, 1, 2}, {{{1}, {1}}, 0}, 50]]ArrayPlot[CellularAutomaton[{10, {2, 1}, 1, 12}, {Table[{1}, {12}], 0}, 50]]ArrayPlot[CellularAutomaton[{Mod[Total[Flatten[#]], 2]&, {}, {{-1, 0}, {0, -1}, {0, 0}, {0, 1}}, 2}, {{{1}, {1}}, 0}, 127]]ArrayPlot[First /@ CellularAutomaton[{97852, {2, 1}, {1, 1}, 2}, {{{{1}}, {{1}}}, 0}, {50, {0}, All}]]ArrayPlot[First@CellularAutomaton[{97852, {2, 1}, {1, 1}, 2}, {{{{1}}, {{1}}}, 0}, {{50}, All, All}]]函数版本 (6)
CellularAutomaton[30, {0, 0, 1, 0, 0}]CellularAutomaton[30][{0, 0, 1, 0, 0}]NestList[CellularAutomaton[30, #]&, {0, 0, 1, 0, 0}, 3]NestList[CellularAutomaton[30], {0, 0, 1, 0, 0}, 3]CellularAutomaton[30, {{1}, 0}, {{{3}}}]CellularAutomaton[30, {{1}, 0}]CellularAutomaton[45, {{1}, 0}]NestList[CellularAutomaton[45], {{1}, 0}, 3]CellularAutomaton[CellularAutomaton[30], {{1}, 0}, 3]应用 (23)
ArrayPlot[CellularAutomaton[30, {{1}, 0}, 40], ColorRules -> {1 -> Red, 0 -> Yellow}]Table[ArrayPlot[CellularAutomaton[n, {{1}, 0}, {20, All}], ImageSize -> 50], {n, 0, 31}]从一系列初始条件中显示 2 色、范围为 2 的极权码为 20 的元胞自动机,
Table[ArrayPlot[CellularAutomaton[{20, {2, 1}, 2}, {IntegerDigits[i, 2], 0}, {30, {-15, 15}}], ImageSize -> 40], {i, 150, 180}]显示 3 色、范围为 3 的极权码 1599 的不同初始条件的结果:
Table[ArrayPlot[CellularAutomaton[{1599, {3, 1}}, {Table[1, {n}], 0}, 80], ImageSize -> {Automatic, 100}], {n, 10}]Table[ArrayPlot[Flatten[{0, 0, 0, #, 0, 0, 0}]& /@ CellularAutomaton[{1599, {3, 1}}, {Table[1, {n}], 0}, 80], ImageSize -> {Automatic, 100}], {n, 10}]Row[Table[ArrayPlot[CellularAutomaton[{1599, {3, 1}}, {{1}, 0}, {{t, t + 200}}], ImageSize -> {Automatic, 200}], {t, 0, 600, 200}]]ArrayPlot[CellularAutomaton[30, {{1}, 0}, 200]]ListLinePlot[Accumulate[(-1) ^ CellularAutomaton[30, {{1}, 0}, {500, {{0}}}]]]Table[Length[NestWhileList[CellularAutomaton[90], SparseArray[1 -> 1, n], Unequal, All]], {n, 20}]GraphPlot[# -> CellularAutomaton[110, #]& /@ Tuples[{0, 1}, 7]]With[{u = RandomInteger[1, 100]}, ArrayPlot[Sum[(-1) ^ i CellularAutomaton[30, ReplacePart[u, 50 -> i], 50], {i, 0, 1}]]]With[{u = RandomInteger[1, 100]}, ArrayPlot[Sum[(0.1 + (-1) ^ i) CellularAutomaton[30, ReplacePart[u, 50 -> i], 50], {i, 0, 1}]]]ArrayPlot[CellularAutomaton[<|"Dimension" -> 2, "OuterTotalisticCode" -> 746|>, {{Table[1, 7]}, 0}, {{{150}}}]]ArrayPlot[CellularAutomaton[<|"Dimension" -> 2, "GrowthCases" -> {3, 6}|>, {{Table[1, 5]}, 0}, {{{200}}}]]ArrayPlot /@ CellularAutomaton[{942, {2, {{0, 2, 0}, {2, 1, 2}, {0, 2, 0}}}, {1, 1}}, {{{1}}, 0}, {{10, 30, 10}}]ArrayPlot[#, ImageSize -> 40, Mesh -> True]& /@ CellularAutomaton["GameOfLife", {{{0, 1, 0}, {0, 0, 1}, {1, 1, 1}}, 0}, 8]Puffer = {{1, 4}, {2, 5}, {3, 1}, {3, 5}, {4, 2}, {4, 3}, {4, 4}, {4, 5}, {8, 1}, {9, 2}, {9, 3}, {10, 3}, {11, 3}, {12, 2}, {15, 1}, {15, 4}, {16, 5}, {17, 1}, {17, 5}, {18, 2}, {18, 3}, {18, 4}, {18, 5}};ArrayPlot[Mean[CellularAutomaton["GameOfLife", {SparseArray[Puffer -> 1], 0}, 200]]]ArrayPlot[Mean[CellularAutomaton["GameOfLife", RandomInteger[1, {100, 100}], 100]]]ArrayPlot[Mean /@ CellularAutomaton["GameOfLife", RandomInteger[1, {10, 200}], 100]]Table[ArrayPlot[CellularAutomaton[{i, {2, 1}, {1, 1}}, {{{1}}, 0}, {{{30}}}], ImageSize -> Tiny], {i, 2, 20, 4}]Table[ArrayPlot[Mean[CellularAutomaton[{i, {2, 1}, {1, 1}}, {{{1}}, 0}, 30]], ImageSize -> Tiny], {i, 2, 20, 4}]ArrayPlot3D[CellularAutomaton[{10, {2, 1}, {1, 1}}, {{{1}}, 0}, 20]]ArrayPlot3D /@ CellularAutomaton[{14, {2, 1}, {1, 1, 1}}, {{{{1}}}, 0}, 10]ArrayPlot[Mean[CellularAutomaton[{14, {2, 1}, {1, 1, 1}}, {{{{1}}}, 0}, {20, {{#}}}]], ImageSize -> Tiny]& /@ Range[0, 15, 5]CellularAutomaton[{Total[#]&, {}, 1 / 2}, {{1}, 0}, 5]//GridCellularAutomaton[{#[[1]] + #[[3]]&, {}, 1}, {{1}, 0}, 5]//GridCellularAutomaton[{{a_, b_} -> a b}, {{I}, 1}, 3]ArrayPlot[Arg[CellularAutomaton[{{a_, b_} -> a b}, {{I}, 1}, 50]]]FullSimplify[CellularAutomaton[{Mod[#[[1]] + #[[2]], 3]&, {}, 1 / 2}, {{a}, 0}, 6], a∈Integers && 0 <= a <= 2]//Grid属性和关系 (9)
ArrayPlot[CellularAutomaton[30, {{1}, 0}, 10], Mesh -> True]ArrayPlot[CellularAutomaton[30, {{1}, 0}, 50], FrameTicks -> True]ArrayPlot[MapAt[Blend[{#, Red}, .5]&, CellularAutomaton[30, {{1}, 0}, 10] /. {0 -> White, 1 -> Blue}, Table[{t, 11}, {t, 11}]]]用 RulePlot 生成图形:
RulePlot[CellularAutomaton[30], {{1}, 0}, 50]用 Image 生成图像,其中每个元胞是一个像素:
Image[CellularAutomaton[30, {{1}, 0}, 50]]CellularAutomaton[30, {1, 0, 1, 1}, 3]ArrayPlot[CellularAutomaton[170, {0, 0, 0, 1, 0, 0, 0, 0, 0}, 20]]CellularAutomaton[30, #][[2]]& /@ Tuples[{1, 0}, 3]IntegerDigits[30, 2, 8]ArrayPlot[CellularAutomaton[{110, {2, {{0, 2, 0}, {2, 1, 2}, {0, 2, 0}}}, {1, 1}}, {{{1}}, 0}, {{{50}}}]]生成它的 RulePlot:
RulePlot[CellularAutomaton[{110, {2, {{0, 2, 0}, {2, 1, 2}, {0, 2, 0}}}, {1, 1}}]]ArrayPlot[CellularAutomaton[<|"GrowthSurvivalCases" -> {{1, 3}, {0, 1, 2}}, "Neighborhood" -> "VonNeumann"|>, {{{1}}, 0}, {{{50}}}]]ArrayPlot[CellularAutomaton[<|"GrowthDecayCases" -> {{1, 3}, {3, 4}}, "Neighborhood" -> "VonNeumann"|>, {{{1}}, 0}, {{{50}}}]]可能存在的问题 (7)
CellularAutomaton[90, {{1}, 0}, 2]CellularAutomaton[170, {{1}, 0}, 2]CellularAutomaton[0, {{1}, 0}, 2]使用 {t,All} 使一个特定类型的所有法则具有相同长度的列表:
CellularAutomaton[170, {{1}, 0}, {2, All}]CellularAutomaton[30, {{0}, 0}, 20]CellularAutomaton[105, {{1}, 0}, 1]CellularAutomaton[105, {{1}, 0}, 2]CellularAutomaton[105, {{1}, 0}]Table[ArrayPlot[CellularAutomaton[n, {{1}, 0}, 20], ImageSize -> {50, 50}], {n, 20, 30}]使用 {t,All} 得到一致宽度:
Table[ArrayPlot[CellularAutomaton[n, {{1}, 0}, {20, All}], ImageSize -> 50], {n, 20, 30}]CellularAutomaton[{19794, 3}, {{1}, 0}, 3]如果用 ArrayPlot 来可视化,值 1 将被显示为黑色:
ArrayPlot[CellularAutomaton[{19794, 3}, {{1}, 0}, 5]]用 RulePlot 基于相应的值显示正确的颜色:
RulePlot[CellularAutomaton[{19794, 3}], {{1}, 0}, 5]显式 ColorRules 也可以避免 ArrayPlot 的默认设置造成的问题:
ArrayPlot[CellularAutomaton[{19794, 3}, {{1}, 0}, 5], ColorRules -> {0 -> White, 1 -> Gray, 2 -> Black}]用 RulePlot 来显示相应的值:
RulePlot[CellularAutomaton[{19794, 3}]]在 CellularAutomaton 中元胞和步骤不根据它们的部分号码编号:
ArrayPlot[CellularAutomaton[30, {{1}, 0}, 4], FrameTicks -> True]ArrayPlot[CellularAutomaton[{30, 2, {{-1}, {0}, {1}}}, {{1}, 0}, 40]]ArrayPlot[CellularAutomaton[{30, 2, {{0}, {1}, {-1}}}, {{1}, 0}, 40]]技术笔记
历史
2002年引入 (4.2) | 在以下年份被更新:2007 (6.0) ▪ 2008 (7.0) ▪ 2016 (10.4) ▪ 2016 (11.0) ▪ 2017 (11.1)
文本
Wolfram Research (2002),CellularAutomaton,Wolfram 语言函数,https://reference.wolfram.com/language/ref/CellularAutomaton.html (更新于 2017 年).
CMS
Wolfram 语言. 2002. "CellularAutomaton." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2017. https://reference.wolfram.com/language/ref/CellularAutomaton.html.
APA
Wolfram 语言. (2002). CellularAutomaton. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/CellularAutomaton.html 年
BibTeX
@misc{reference.wolfram_2026_cellularautomaton, author="Wolfram Research", title="{CellularAutomaton}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/CellularAutomaton.html}", note=[Accessed: 07-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_cellularautomaton, organization={Wolfram Research}, title={CellularAutomaton}, year={2017}, url={https://reference.wolfram.com/language/ref/CellularAutomaton.html}, note=[Accessed: 07-August-2026]}