Home > other >  Which big brother to help me have a look at this piece of code
Which big brother to help me have a look at this piece of code

Time:09-16

If SN (I). E <=0% if cluster heads energy depletes with transmission
Dead_nodes=dead_nodes + 1;
Operating_nodes=operating_nodes - 1;
SN (I). The cond=0;
SN (I). The rop=RND;
End
The else
Dis2=inf (1, n);
For i2=1: n
If (SN (i2). Cond==1) && (SN (i2). The role==1)
Dis2 (i2)=SN (i2). DTS ^ 2 + ((SN (i2). X - SN (I). X) ^ 2 + (SN (i2). Y. - SN (I), y) ^ 2);
End
End
[~, i2]=min (Dis2);
Dts1=((SN (i2). X - SN (I). X) ^ 2 + (SN (i2). Y. - SN (I), y) ^ 2);
Dts2=SN (i2). DTS ^ 2;
ETx=(EDA) Eelec + Eamp * k * *, k + SN (I). The DTS ^ 2;
SN (I). E=SN (I). E - ETx.
ERx=(EDA) Eelec + * k;
SN (i2). E=SN (i2). E - ERx;
If SN (I). E <=0% if cluster heads energy depletes with transmission
Dead_nodes=dead_nodes + 1;
Operating_nodes=operating_nodes - 1;
SN (I). The cond=0;
SN (I). The rop=RND;
End
If SN (i2). E <=0% if cluster heads energy depletes with transmission
Dead_nodes=dead_nodes + 1;
Operating_nodes=operating_nodes - 1;
SN (i2). The cond=0;
SN (i2) rop=RND;
End
End
End

end
  • Related