Information Technology Reference
In-Depth Information
% display the new output
image(20*y+32); axis image; colormap jet
title(['Step: ',num2str(s),' Initial state: ',init_cond,' PRESS ANY KEY TO CONTINUE']);
% press a key for the next step
waitforbuttonpress
end
ith these two simple programs one may st art to observe emergent patterns in
generalied cellular automata. First, running the program exactly in the form writ-
ten above (e.g. run C
(100) for a 100 st eps run) a sequence of growing binary
patterns is observed. The color code used here associates color red with 1 and
blue with -1.
One can easily simulate another CA sy stem with a different behavior re-
editing the CCE.M file. For example after replacing [-1,-2,-,-,
-7] with [-1,-2,-,-6,-7] the result wi ll be a sequence of “snow-flake” like
binary patterns. oreover, if the initial Z vector is used but the initial B vector is
replaced with [1 1 1 1 -.5 1 1 1 1] and the output function is chosen
y0.(abs(w1 ) -abs(w-1)) the result is a sequence of colored patterns corre-
sponding to a continuous-state cellular automaton. Observe that much of the flexi-
bility in programming different behaviors using the same code is due to the use of
a universal piecewise-linear parametric functional (the function with nested
absolute values).
3.3.2 Coupled GCAs
In the implementation of the cell for the uncoupled CA there is no temporal
dynamics involved and the output is computed just as a nonlinear function of the
nine inputs. In fact, when called from the main function CU the function
CCEL updates all cells simultaneously since it performs matrix compu-
tation (all inputs, for example u1, are matrices of the same sie as the CNN). The
CCEL function implements a layer of CNN cells, but since the model is
simplified there is no temporal dynamics included. In order to implement a cou-
pled CA we should change this cell function such that it will implement the dy-
namic evolution of a continuous time CNN. The resulting code of the program
CCCE.M is listed next:
function y=gca_c_cell(u1,u2,u3,u4,u5,u6,u7,u8,u9)
Delta_T=0.1;
% integration step (the smallest the best precision but takes
longer)
T=4; % the duration of the Euler integration;
B=[0 -1 0 0 1 0 0 -1 0]; % cell parameters (gene)
A=[1 1 1 1 -3 1 1 1 1];
z=0;
%---------------------------------------------------------------------------------------------------
[m n]=size(u1);
 
Search WWH ::




Custom Search