Information Technology Reference
In-Depth Information
N=neigh*2;
elseif tip=='a'
N=2^neigh;
end
% compute values needed for canonical PWL representation of cells
[s, tr]=id2t(ID,N);
% determine the z offset in (8) for the canonical PWL implementation
offset_cell;
% load the initial state (saved previously with -1/+1 values )
eval(['load ',name]);
x0=(x0+1)/2; % move to 0 and 1 form
% compute the size of the array
[m n]=size(x0);
% depending on typ determine the neighborhood indexes
i=1:m; j=1:n;
% generate indexes of the neighbor cells to be used by the proj.. file
% be sure that you previously defined
% a file corresponding to your size of the grid (neigh1.m or neigh2.m)
eval(['neigh',typ(1)]);
% initialize the Small Worlds model with f=fraction
sworld1;
% MAIN LOOP ================================
if dim==1 X=[]; end
for st=1:steps
if dim==1 X=[X; x0]; end;
sworld2; % apply the Small Worlds model
% compute projection
% be sure that you previously defined a file corresponding to your "typ"
eval(['proj',typ]);
% compute the cells output
out_cell;
% visualize the dynamics
if (vis==1 & dim==2)
clf
image(64*x0); axis image;
title(['Ca type: ',typ,' ID=',num2str(ID),' Iteration ',num2str(st)])
waitforbuttonpress;
end
end
if (vis==1 & dim==1)
clf
image(64*X); axis image;
title(['Ca type: ',typ,' ID=',num2str(ID),' Iterations ',num2str(steps)])
end
Search WWH ::




Custom Search