30.06.2013 Views

Leader (and sub Leader) Election per uniformare e ... - Automatica

Leader (and sub Leader) Election per uniformare e ... - Automatica

Leader (and sub Leader) Election per uniformare e ... - Automatica

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

end<br />

end<br />

F = F + B;<br />

end<br />

M=F’;<br />

i = index + 1;<br />

while ((flagTwo == 0) && (i < (dim(1,1) + 1)))<br />

%Ciclo la riga finche non faccio<br />

%aggiornamento o finisco la riga<br />

if ((P(j,i) == 1) && (v(i) < maxv))<br />

v(i) = v(i) + 1;<br />

v(index) = v(index) - 1;<br />

B(j,index) = 0;<br />

B(j,i) = 1;<br />

flagTwo = 1;<br />

end<br />

i = i + 1;<br />

end<br />

end<br />

j = j + 1;<br />

end<br />

if (j == (dim(1,1) + 1)) %Se non ho aggiornato dopo<br />

%aver passato tutta la colonna<br />

%di B il nodo ha il minimo<br />

%numero di figli<br />

r(index) = 1;<br />

end<br />

49

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!