0
Cellular Automata Mathematicaファイルからこれを見つけましたが、パターンと選択肢は何ですか?このコードブロックでMathematica /ノートブックソース、パターン、代替のセルオートマトンルール関数
、パターンは何を意味する:
CellularAutomaton[{ { 0, Blank[], 3} -> 0,
{ Blank[], 2, 3} -> 3,
{ 1, 1, 3 } -> 4,
{ Blank[], 1, 4} -> 4,
{ Alternatives[1, 2] << 1 or 2 >>, 3, Blank[]} -> 5,
{ Pattern[$CellContext`p, Alternatives[0, 1]], 4, Blank[]} -> 7 - $CellContext`p,
{ 7, 2, 6} -> 3,
{ 7, Blank[], Blank[]} -> 7,
{ Blank[], 7, Pattern[$CellContext`p, Alternatives[1, 2]]} -> $CellContext`p,
{ Blank[], Pattern[$CellContext`p, Alternatives[5, 6]], Blank[]} -> 7 - $CellContext`p,
{ Alternatives[5, 6], Pattern[$CellContext`p, Alternatives[1, 2]], Blank[]} -> 7 - $CellContext`p,
{ Alternatives[5, 6], 0, 0} -> 1,
{ Blank[], Pattern[$CellContext`p, Alternatives[1, 2]], Blank[]} -> $CellContext`p,
{ Blank[], Blank[], Blank[]} -> 0}, {
ありがとう、私はそこにその質問を投げると思って、誰かが応答しました。 –
私はまだパターンマッチの役割を理解していません。代替案と代替案とのパターンマッチの違いは何でしょうか。 –
例:{Pattern [$ CellContext'p、Alternatives [0,1]]、4、Blank []} - > 7 - $ CellContext'p、...パターンP、(0または1)しかし、 "7 - $ CellContext'p"はどういう意味ですか?また、代替案だけでなく、なぜパターンがここで使われているのですか? –