무엇을 시도하고 있습니까? JMP가 어떤 종류의 애니메이션을 할 수 있다는 것을 보여주는 데모가 있습니까? https://en.wikipedia.org/wiki/Rule_30 에 대한 계산이 있습니까? 완전히 다른 것이고 이것은 단지 예일 뿐입니까?
편집하다:
어떤 경우이든 여기에 내 코드를 게시합니다(아직도 많은 최적화가 가능합니다)
더 보기...
Names Default To Here(1);
xor = Function({first, second}, {Default Local},
return((first | second) & !(first & second));
);
check_rule30 = function({items}, {Default Local},
// https://en.wikipedia.org/wiki/Rule_30
res = xor(items[1], items[2] | items[3]);
return(res);
);
initial_state = function({width}, {Default Local},
m = J(Floor(width / 2) + 1, width + !Mod(width, 2), 0);
m[1, Floor(width / 2) + 1] = 1;
return(m);
);
cellular_automaton_rule30 = function({width}, {Default Local},
m = initial_state(width);
For(r = 2, r <= N Rows(m), r++,
For(c = 1, c <= N Cols(m[r, 0]), c++,
If(c == 1, // fill [0] for edges
three = [0] || m[r - 1, c::c + 1];
, c == N Cols(m[r, 0]),
three = m[r - 1, c - 1::c] || [0];
,
three = m[r - 1, c - 1::c + 1];
);
res = check_rule30(three);
m[r, c] = res;
);
);
return(m);
);
magnify_matrix = function({m, magnification = 1}, {Default Local},
If(magnification == 1,
return(m);
);
magnified = J(N Rows(m) * magnification, N Cols(m) * magnification);
magnified = Transform Each({z, {row, col}}, magnified,
// and filling each value with one from the small matrix
m[Floor((row - 1) / magnification) + 1, Floor((col - 1) / magnification) + 1]
);
return(magnified);
);
animate_matrix = Function({m_magnified}, {Default Local},
// Substitute Into(m_magnified, 1, -16777215); // to make white white
start = Tick Seconds();
initial = J(N Row(m_magnified), N Col(m_magnified), 0);
initial[1::magnification, 0] = Substitute(m_magnified[1::magnification, 0], 1, -16777215);
img = New Image(initial);
For(i = 1, i < N Rows(m), i++,
indices = (i * magnification + 1)::((i + 1) * magnification);
cur_row = m_magnified[indices, 0];
If(i == N Rows(m) - 1, // could be moved outside of the loop
Substitute Into(cur_row, 1, -16777215);
,
Substitute Into(cur_row, 1, -65280);
);
Substitute Into(cur_row, 1, -65280);
Substitute Into(initial, -65280, -16777215);
initial[indices, 0] = cur_row;
img << Add Frame(10);
img << Set Pixels(initial);
);
wait(0);
end = Tick Seconds();
Write(Eval Insert("animate_matrix: ^Round(end - start, 3)^s.\!N"));
nw = New Window("Multi-Frame Image", img);
durs = img << Get Frame Durations();
For(i = 0, i < img << Get N Frames, i++, // might be off by one
img << Set Current Frame(i);
nw << reshow();
dur = durs[i + 1] / 800.0; // use to modify the speed of animation
Wait(dur);
);
return(img);
);
view_matrix = function({m}, {Default Local},
nw = New Window("Matrix",
pic = New Heat Image(m,
gradient({Color Theme("White to Black"), Scale Values([0 1]), Reverse Gradient(1)})
)
);
);
width = 250;
magnification = 5;
start = Tick Seconds();
m = cellular_automaton_rule30(width);
wait(0);
end = Tick Seconds();
Write(Eval Insert("cellular_automaton_rule30: ^Round(end - start, 3)^s.\!N"));
start = Tick Seconds();
m_magnified = magnify_matrix(m, magnification);
wait(0);
end = Tick Seconds();
Write(Eval Insert("magnify_matrix: ^Round(end - start, 3)^s.\!N"));
animation = animate_matrix(m_magnified);
wait(0);
Write("Done\!N");

솔직히 말해서 Zoom을 제대로 사용하는 데 시간이 꽤 걸렸어요.
첫 번째 아이디어: Data=1인 행으로 보기를 제한합니다. 항목이 계산되는 동안 점점 더 많은 항목이 표시되어 축소가 발생합니다.
하지만 이러한 접근 방식은 예상대로 작동하지 않았습니다. 아래를 참조하세요.
데이터 필터를 확인하세요. 올바른 설정인 Data=1 로 시작합니다.
하지만 열이 지워지고 계산이 시작되면 그러한 데이터는 더 이상 존재하지 않으며 데이터 필터는 설정을 잊어버립니다(!!!).
이 버그는 Jmp 대시보드를 사용한 Outlier(:alien:) 스크리닝 - 어떻게? 에서 처음 설명되었습니다.
- 일부 해결 방법은 여기에서 찾을 수 있습니다.
- 버그 수정을 원함: 로컬 데이터 필터: 옵션: 현재 데이터로 제한하거나 제한하지 않음
- 이러한 문제를 해결하는 보다 우아한 방법: :folded_hands: 열 속성: 포함 값

또 다른 접근법은 무한 루프에 대한 것입니다.
... 즉석에서 데이터 테이블을 생성하여
dt = New Table( "cellular automaton",
New Column( "pos", Nominal ),
New Column( "step", Nominal ),
New Column( "status", Nominal )
);
dt << add rows( 1 );
:pos[1] = 0;
:step[1] = 1;
:status[1] = 1;
t0 = hptime();
gb = dt << Graph Builder(
Show Control Panel( 0 ),
Show Title( 0 ),
Show X Axis( 0 ),
Show X Axis Title( 0 ),
Variables( X( :pos ), Y( :step ), Color( :status ) ),
Elements( Heatmap( X, Y, Legend( 1 ) ) ),
SendToReport(
Dispatch( {}, "pos", ScaleBox, {Label Row( Tick Mark Style( "Long Divider" ) )} ),
Dispatch( {}, "step", ScaleBox,
{Reversed Scale, Label Row( Tick Mark Style( "Long Divider" ) )}
),
Dispatch( {}, "400", ScaleBox,
{Legend Model(
1,
Properties( 1, {Fill Color( 0 )}, Item ID( "1", 1 ) ),
Properties( 2, {Fill Color( 2 )}, Item ID( "0", 1 ) )
)}
)
)
);
wait(0);
cells = [1];
j=4;
For( i = 2, i > 0, i++,
//i=2
cells = Insert( Insert( cells, 0, 1 ), 0 );
cells0 = Insert( Insert( cells, 0, 1 ), 0 );
cells = Transform Each( {dummy, idx}, cells,
//idx=3;
myPattern = 100 * cells0[idx] + 10 * cells0[idx + 1] + cells0[idx + 2];
Match( mypattern,
100, 1,
11, 1,
10, 1,
1, 1,
0 // all other variants give 0
);
);
Ncells = N Items( cells );
nr = N Rows( dt );
dt << add rows( 2 * i - 1 );
rows = nr + (1 :: Ncells);
dt[rows, "step"] = J( Ncells, 1, i );
dt[rows, "pos"] = ((1 :: Ncells) - i)`;
dt[rows, "status"] = cells;
if(hptime()-t0>10000,wait(0);t0=hptime())
);아니면 GraphBuilder에서 Heatmap 으로 표시하고 기록하면 됩니다.
애니메이션이 어떻게 보여야 할지 잘 모르겠지만 예를 들어 새 이미지, 픽셀 설정 및 광고 프레임을 사용하여 이와 같은 작업을 수행할 수 있습니다.