forked from johannesgerer/jburkardt-m
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cellular_automaton.html
143 lines (116 loc) · 3.63 KB
/
cellular_automaton.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<html>
<head>
<title>
CELLULAR_AUTOMATON - Demonstrate 1D Cellular Automaton Rule 30
</title>
</head>
<body bgcolor="#EEEEEE" link="#CC0000" alink="#FF3300" vlink="#000055">
<h1 align = "center">
CELLULAR_AUTOMATON <br> Demonstrate 1D Cellular Automaton Rule 30
</h1>
<hr>
<p>
<b>CELLULAR_AUTOMATON</b>
is a MATLAB program which
demonstrates the behavior of the 1D Cellular Automaton rule #30.
</p>
<p>
This program carries out iterations of the 1D cellular automaton
known as rule 30.
</p>
<p>
Given an initial linear array of 0's and 1's, rule 30 produces a new
array using transformations based on each value and the value of its
left and right neighbors, as follows:
<pre>
111 110 101 100 011 010 001 000
V V V V V V V V
0 0 0 1 1 1 1 0
</pre>
Note that there are 256 = 2^8 possible ways to fill in this output
chart, and that rule 30 gets its index by the fact that
(0,0,0,1,1,1,1,0) can be interpreted as the binary representation of 30.
</p>
<p>
For instance, if the current values of X(4), X(5) and X(6) are
0, 1 and 1, respectively, then the new value of X(5) will be 1.
</p>
<p>
The first and last entries of the array must be treated specially, since
they don't have a left or right neighbor. One simple treatment is
to assume that there are phantom neighbors whose values are both 0.
Another is to enforce periodic boundary conditions.
</p>
<h3 align = "center">
Licensing:
</h3>
<p>
The computer code and data files described and made available on this
web page are distributed under
<a href = "../../txt/gnu_lgpl.txt">the GNU LGPL license.</a>
</p>
<h3 align = "center">
Languages:
</h3>
<p>
<b>CELLULAR_AUTOMATON</b> is available in
<a href = "../../c_src/cellular_automaton/cellular_automaton.html">a C version</a> and
<a href = "../../cpp_src/cellular_automaton/cellular_automaton.html">a C++ version</a> and
<a href = "../../f77_src/cellular_automaton/cellular_automaton.html">a FORTRAN77 version</a> and
<a href = "../../f_src/cellular_automaton/cellular_automaton.html">a FORTRAN90 version</a> and
<a href = "../../m_src/cellular_automaton/cellular_automaton.html">a MATLAB version</a>.
</p>
<h3 align = "center">
Related Data and Programs:
</h3>
<h3 align = "center">
Reference:
</h3>
<p>
<ol>
<li>
Stephen Wolfram,<br>
A New Kind of Science,<br>
Wolfram Media, 2002,<br>
ISBN13: 978-1579550080,<br>
LC: QA267.5.C45.W67.
</li>
</ol>
</p>
<h3 align = "center">
Source Code:
</h3>
<p>
<ul>
<li>
<a href = "cellular_automaton.m">cellular_automaton.m</a>, the source code.
</li>
<li>
<a href = "timestamp.m">timestamp.m</a>,
prints the YMDHMS date as a timestamp.
</li>
</ul>
</p>
<h3 align = "center">
Examples and Tests:
</h3>
<p>
<ul>
<li>
<a href = "cellular_automaton_output.txt">cellular_automaton_output.txt</a>,
the output file.
</li>
</ul>
</p>
<p>
You can go up one level to <a href = "../m_src.html">
the MATLAB source codes</a>.
</p>
<hr>
<i>
Last revised on 17 May 2013.
</i>
<!-- John Burkardt -->
</body>
<!-- Initial HTML skeleton created by HTMLINDEX. -->
</html>