形式上,元胞自動機用 4 元組 ( Z , S , N , f ) {\displaystyle (Z,S,N,f)} 表示,其中
Z {\displaystyle Z} 是有限或無限的 格點
S {\displaystyle S} 是單元格 狀態 或 值 的有限集合
N {\displaystyle N} 是有限的 鄰域
f {\displaystyle f} 是由轉換表或規則定義的 區域性轉換函式
格點 是有限或無限的離散規則網格,在有限數量的維度上包含單元格。每個 單元格 由其離散的 位置 (每個維度上的整數)及其離散的 值 (有限整數集中的一個)定義。時間也是離散的。單元格的未來狀態(時間 t + 1 {\displaystyle t+1} )是周圍有限數量單元格(稱為鄰域)的當前狀態(時間 t − 1 {\displaystyle t-1} )的函式。
為了提高可讀性,接下來的定義將重點放在一維一階元胞自動機上。
無限全域性狀態是 配置 C ∈ S Z {\displaystyle C\in S^{Z}} 。 S {\displaystyle S} 是有限集 k = | S | < ∞ {\displaystyle k=|S|<\infty } 的 單元格狀態 c ∈ S {\displaystyle c\in S} ,為了形式化,這些狀態被列舉為 S = { 0 , 1 , … , k − 1 } {\displaystyle S=\{0,1,\dots ,k-1\}} 。格點 Z {\displaystyle Z} 是 迴圈群 的無限 整數 { . . . , − 1 , 0 , 1 , 2 , . . . } {\displaystyle \{...,-1,0,1,2,...\}} 。格點中每個單元格的位置由 位置索引 x ∈ Z {\displaystyle x\in Z} 描述。配置通常寫成字串。
C = … c − 1 c 0 c 1 c 2 … c x − 1 c x c x + 1 … {\displaystyle C=\dots c_{-1}c_{0}c_{1}c_{2}\dots c_{x-1}c_{x}c_{x+1}\dots }
有限的全域性狀態是一個有限配置 C ∈ S Z {\displaystyle C\in S^{Z}} ,其中 Z {\displaystyle Z} 是一個有限格,一個包含 N {\displaystyle N} 個整數的有限集 { 0 , 1 , 2 , . . . , N − 1 } {\displaystyle \{0,1,2,...,N-1\}} 。
C = c 0 c 1 … c x − 1 c x c x + 1 … c N − 2 c N − 1 {\displaystyle C=c_{0}c_{1}\dots c_{x-1}c_{x}c_{x+1}\dots c_{N-2}c_{N-1}}
有限配置及其部分通常可以寫成由字母表開頭的希臘小寫字母表示的字串 ( α {\displaystyle \alpha } , β {\displaystyle \beta } ,...)。
字串可以簡潔地寫成數字。一個包含 N {\displaystyle N} 個字元的字串 C {\displaystyle C} 來自一個包含 | S | {\displaystyle |S|} 個符號的集合,被轉換為一個 N {\displaystyle N} 位基 | S | {\displaystyle |S|} 數字。通常字串從左到右索引,但對於數字表示法,從右到左索引更直觀。
α = ∑ i = 0 N − 1 k N − 1 − i c i = k N − 1 c 0 + ⋯ + k 1 c N − 2 + k 0 c N − 1 {\displaystyle \alpha =\sum _{i=0}^{N-1}k^{N-1-i}c_{i}=k^{N-1}c_{0}+\cdots +k^{1}c_{N-2}+k^{0}c_{N-1}}
鄰域的大小和位置
鄰域 A {\displaystyle A} 的大小為 m = | A | {\displaystyle m=|A|} ,由配置內部的相對位置集合定義。
A = { a 0 , a 1 , … , a m − 1 } {\displaystyle A=\{a_{0},a_{1},\dots ,a_{m-1}\}}
將集合 A {\displaystyle A} 應用到觀測到的單元格 c x {\displaystyle c_{x}} 上,即可得到該單元格的鄰域。
n x = c x + a 0 c x − a 1 … c x + a m − 1 {\displaystyle n_{x}=c_{x+a_{0}}c_{x-a_{1}}\dots c_{x+a_{m-1}}}
術語“鄰域”既可以指代相對距離集合,也可以指代與觀測單元格相關的實際單元格子串。
鄰域值 n x {\displaystyle n_{x}} 的緊湊表示是單個整數,定義為 m {\displaystyle m} 位以 k {\displaystyle k} 為基的數字。
n x = ∑ i = 0 m − 1 k m − 1 − i c x + a i = c x + a 0 k m − 1 + c x + a 1 k m − 2 + ⋯ + c x + a m − 1 k 0 {\displaystyle n_{x}=\sum _{i=0}^{m-1}{k^{m-1-i}c_{x+a_{i}}}=c_{x+a_{0}}k^{m-1}+c_{x+a_{1}}k^{m-2}+\dots +c_{x+a_{m-1}}k^{0}}
鄰域單元格索引和區域性轉換函式
有關常見鄰域的定義,請參見鄰域。
區域性轉換函式
f : S N ↦ S {\displaystyle f:S^{N}\mapsto S}
根據當前觀測單元格的鄰域計算單個未來單元格 c x {\displaystyle c_{x}} 的值。
c x t + 1 = f ( n x t ) {\displaystyle c_{x}^{t+1}=f(n_{x}^{t})}
轉換表 透過列出每個輸入值的輸出值來定義區域性轉換函式。
n -> f(n)
-----------
000 -> 0
001 -> 0
........
111 -> 0
規則 f {\displaystyle f} 是區域性轉換函式的緊湊表示。它是一個單個整數,定義為 m {\displaystyle m} 位以 k {\displaystyle k} 為基的數字。
f = ∑ i = 1 k m − 1 f ( i ) k i = f ( k m − 1 ) k k m − 1 + ⋯ + f ( 1 ) k 1 + f ( 0 ) k 0 {\displaystyle f=\sum _{i=1}^{k^{m}-1}{f(i)k^{i}}=f(k^{m}-1)k^{k^{m}-1}+\dots +f(1)k^{1}+f(0)k^{0}}
另見
元胞自動機的全域性動力學由全域性轉換函式 描述
F : S Z ↦ S Z {\displaystyle F:S^{Z}\mapsto S^{Z}}
F {\displaystyle F} 將當前(現在)配置 C t {\displaystyle C^{t}} 轉換為下一個(未來)配置 C t + 1 {\displaystyle C^{t+1}}
C t + 1 = F ( C t ) {\displaystyle C^{t+1}=F\left(C^{t}\right)}
全域性轉換函式 F {\displaystyle F} 由區域性轉換函式 f {\displaystyle f} 定義為
F ( … c x − 1 c x c x + 1 … ) = … f ( n x − 1 ) f ( n x ) f ( n x + 1 ) … {\displaystyle F(\dots c_{x-1}c_{x}c_{x+1}\dots )=\dots f(n_{x-1})f(n_{x})f(n_{x+1})\dots }
晶格邊界大小(左和右)
無限元胞自動機沒有邊界,因此其邊界描述 B {\displaystyle B} 被省略。但使用有限系統模擬無限系統是不可行的。模擬必須關注長度為 l {\displaystyle l} 的有限部分。
區域性轉換函式中使用的鄰域在左側越過晶格邊界 r L {\displaystyle r_{L}} 個單元格,在右側越過 r R {\displaystyle r_{R}} 個單元格。
越過問題有兩個常見的解決方案
晶格被包裹成一個圓圈(對於 2D 元胞自動機則是環面)
鄰域越過部分的值被明確定義為邊界 B {\displaystyle B}
迴圈邊界 經常被使用,因為沒有必要明確定義邊界值,並且不會將外部資訊引入元胞自動機,否則這些資訊會導致邊界處的干擾。
有限格子的元胞自動機的狀態是格子 S Z {\displaystyle S^{Z}} 中的一個配置 ,其中 Z {\displaystyle Z} 是整數的迴圈群 ,對 N {\displaystyle N} 取模 ( { 0 , 1 , . . . , N − 1 } {\displaystyle \{0,1,...,N-1\}} )。
C = c 0 c 1 … c x − 1 c i c x + 1 … c N − 1 c ∈ S {\displaystyle C=c_{0}c_{1}\dots c_{x-1}c_{i}c_{x+1}\dots c_{N-1}\qquad c\in S}
迴圈位置索引計算為
x ∘ = x mod N x ≤ 0 ∨ x > N {\displaystyle x_{\circ }=x\mod N\qquad x\leq 0\vee x>N}
格子的邊界(左和右)
顯式定義的邊界 比較少見,因為簡單常數值只對週期為1的靜止背景上觀察事件的CA有用。邊界可以定義為單個集合(左和右部分組合),長度為 k − 1 {\displaystyle k-1} 的單元格值(沒有索引為0的邊界單元格)
B = { b − k 0 , … b − 2 , b − 1 , b l , b N + 1 , … , b k − k 0 − 1 } b ∈ S {\displaystyle B=\{b_{-k_{0}},\dots b_{-2},b_{-1},b_{l},b_{N+1},\dots ,b_{k-k_{0}-1}\}\quad b\in S}
對於時空週期性的靜止背景,可以使用時間相關的邊界 B = B ( t ) {\displaystyle B=B(t)} .
二維格子中的鄰域
n 維CA的定義類似於一維CA,格子變為n 維, k {\displaystyle k} 和 k 0 {\displaystyle k_{0}} 變為長度為 n {\displaystyle n} 的向量。
二維格子可以用不同的方式用單元格進行平鋪
方格(4重旋轉對稱 )
三角形網格(3重對稱)或六邊形網格(6重對稱)
準週期網格(彭羅斯拼貼 )
二維元胞自動機通常用於模擬真實動態系統(流體和氣體動力學)
另見
One further generalization of the concept of a CA extends the n -dimensional construct. Given a finitely generated group, G {\displaystyle G} , and a alphabet, A {\displaystyle A} , we may define the configuration space to be C = A G {\displaystyle C=A^{G}} . That is, each configuration is a map from G {\displaystyle G} into A {\displaystyle A} . If G {\displaystyle G} is abelian, then the group is isomorphic to some quotient space of Z n {\displaystyle Z^{n}} and may be regarded as a n -dimensional lattice with possibly periodic boundary conditions. This space admits a group action, where c g ( h ) = c ( g ′ h ) {\displaystyle c^{g}(h)=c(g'h)} where g ′ {\displaystyle g'} is the inverse of g {\displaystyle g} . Any finitely generated group is a metric space, in which the distance between any two elements, d ( g , h ) {\displaystyle d(g,h)} can be defined to be the minimum length of the set of paths connecting g {\displaystyle g} and h {\displaystyle h} on the groups Cayley graph. We define a metric on the configuration space, d ( c , c ′ ) {\displaystyle d(c,c')} to be 0 if the two configurations are identical, and the infimum of 1 / ( 1 + d ( e , h ) ) {\displaystyle 1/(1+d(e,h))} over the set of h {\displaystyle h} such that c {\displaystyle c} and c ′ {\displaystyle c'} disagree at h {\displaystyle h} and where e {\displaystyle e} denotes the identity element of the group. We define a cellular automata to be a continuous mapping, f : C → C {\displaystyle f:C\to C} , that commutes with the group action and an initial configuration c 0 {\displaystyle c_{0}} . The evolution of the system is defined by c n + 1 = f ( c n ) {\displaystyle c_{n+1}=f(c_{n})} .
如果不僅使用當前配置,還使用過去配置來計算未來,則 CA 為更高階。 二階區域性轉移函式定義為
c x t + 1 = f ( n x t , n x t − 1 ) {\displaystyle c_{x}^{t+1}=f(n_{x}^{t},n_{x}^{t-1})}
二階區域性轉移函式通常用於構造可逆規則。