Cellular Automata
初出 1970 · John Conway — Conway's Game of Life (1970); roots in von Neumann & Ulam, 1940s; Wolfram, 1983. · 年表 ↗
コミュニティ・通称 名称 — von Neumann / Ulam の研究(1940年代)由来の記述的用語。Conway の Game of Life(1970) が最も有名な実例。人名エポニムではない。
ひとことで 離散グリッド上の各セルが近傍状態に基づいて時間発展する系。Game of Life・Elementary CA・反応拡散の前駆体など。
コード
上のデモの実際のスケッチ(サンドボックスで再現可能)。これで全部です。
cellular-automata/index.html
const SEED = Math.floor(Math.random()*1e9);
// Conway's Game of Life. Live cells are coloured by "age" (how many
// consecutive steps they've been alive) for visual depth.
let cols, rows, cell, grid, age;
function setup() {
randomSeed(SEED);
const s = Math.min(windowWidth, windowHeight);
createCanvas(s, s);
cell = Math.max(4, Math.floor(s / 110));
cols = Math.floor(width / cell);
rows = Math.floor(height / cell);
grid = new Uint8Array(cols * rows);
age = new Uint16Array(cols * rows);
for (let i = 0; i < grid.length; i++) grid[i] = random() < 0.32 ? 1 : 0;
colorMode(HSB, 360, 100, 100);
noStroke();
frameRate(14);
}
function draw() {
background(0, 0, 6);
const next = new Uint8Array(cols * rows);
for (let y = 0; y < rows; y++) {
for (let x = 0; x < cols; x++) {
let n = 0;
for (let dy = -1; dy <= 1; dy++)
for (let dx = -1; dx <= 1; dx++) {
if (dx === 0 && dy === 0) continue;
const nx = (x + dx + cols) % cols;
const ny = (y + dy + rows) % rows;
n += grid[ny * cols + nx];
}
const idx = y * cols + x;
const alive = grid[idx] ? (n === 2 || n === 3) : (n === 3);
next[idx] = alive ? 1 : 0;
age[idx] = alive ? Math.min(255, age[idx] + 1) : 0;
if (alive) {
const a = age[idx];
fill((200 + a * 2) % 360, 70, 95);
rect(x * cell, y * cell, cell - 1, cell - 1);
}
}
}
grid = next;
// Reseed a patch occasionally to keep it lively.
if (frameCount % 240 === 0) {
for (let k = 0; k < 200; k++) {
const i = Math.floor(random(grid.length));
grid[i] = 1;
}
}
}仕組み
セルのグリッド・有限の状態集合・近傍(8 近傍=Moore、4 近傍=von Neumann など)・遷移規則を定義し、同期更新を繰り返す:(1) 各セルで自分と近傍の現状態を読み、(2) 規則で次状態を求め、(3) 全更新を同時適用(同ステップ内で近傍に影響しないよう別バッファを使う)。Conway のライフは誕生/生存数(B3/S23)、1次元 Elementary CA は 3 セル 8 通りの近傍を 8 ビットの「規則番号」(Rule 30、Rule 110 など)に対応づける。単純な規則でもカオス的・チューリング完全になりうる。
パラメータ
ruleset: string — The transition rule (e.g. an 8-bit elementary rule, or Life’s B3/S23 birth/survival sets).neighborhood: string — Which neighbours are counted (von Neumann, Moore).gridSize: number — Number of cells per side.steps: number — Number of generations advanced.
系譜
よく組み合わされるアルゴリズム
- HSL / Hue Cycle · 3 作品
- Perlin / Simplex Noise · 2 作品
- Geometric / Hexagonal Tiling · 2 作品
- Particle System · 2 作品
- Voronoi Diagram · 1 作品
- Delaunay Triangulation · 1 作品
- Glitch / Datamosh · 1 作品
- Truchet Tiles · 1 作品
- Sonification · 1 作品
- Bezier / Catmull-Rom Splines · 1 作品
このアルゴリズムを使う作品 (15)
Abstraction
hevey
Bomb
scott-draves
Calculating the Universe
troika
Dive
rafael-rozendaal
Gen 3
dca
Mental pathways
fabianospeziari-x-donnoh
mono no aware
ixnayokay
Patterns of Life
vamoss
Pre-Process
casey-reas
Rain Blooms
kazuhiro-tanimoto
Rechnender Raum
ralf-baecker
RGB Elementary Cellular Automaton
ciphrd
Rule 110
raven-kwok
Swimming Pool
paul-brown
Zoologic
ixnayokay
参考文献
最終更新 2026-07-16