-
Notifications
You must be signed in to change notification settings - Fork 0
/
cyclic_ca.wxm
50 lines (40 loc) · 1.42 KB
/
cyclic_ca.wxm
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
/* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/
/* [ Created with wxMaxima version 22.04.0 ] */
/* [wxMaxima: input start ] */
(/* CA package loading */
load("path/cyclic.lisp"),
/* A 100 x 100 cellular space */
nr: 100,
nc: 100,
/* cellular automaton parameters */
n_states: 10,
threshold: 1,
n_iterations: 100,
/* initial random state */
ini: apply(matrix, makelist(makelist(random(n_states),k,1,nc),j,1,nr)),
/* simulation process */
im: ca_cyclic_von_neumann(ini,n_states,threshold,n_iterations),
/* global drawing options */
global_options:
[terminal = animated_gif,
delay = 20,
file_name = "cyclic_ca",
dimensions = [300,300]],
frames:
makelist(gr2d(title = concat("step ",k),
colorbox = false,
axis_top = false,
axis_right = false,
axis_left = false,
axis_bottom = false,
xtics = none,
ytics = none,
ztics = none,
palette = [3,21,-10],
image(im[k+1],0,0,1,1)),
k,0,n_iterations),
/* this part may take a while! */
apply(draw, append(global_options, frames)) )$
/* [wxMaxima: input end ] */
/* Old versions of Maxima abort on loading files that end in a comment. */
"Created with wxMaxima 22.04.0"$