The function initial_config
%The inputs to this function are n, the number of agents, r the radius, and %S, the number of internal states, its output is [x0,y0], the position and %state vectors of the initial configuration n = 9; r = 7; S = 3; x0(1) = 0; %this sets the position of the left most agent at 0 for i = 2:n x0(i) = x0(i-1) + ceil(r*rand); %this particular rules adds agents at %random positions, but can be changed end for i=1:n y0(i) = ceil(rand*S); %this rule chooses states randomly, and can be changed end