clc; clear; close all; load('new_point'); round=1; death_nodes=[]; communication=[]; energy=[]; while round<=100 for i=1:1:node_number S(i).father=-1; S(i).child_num=0; S(i).intree=0; S(i).data=data_length; S(i).ifleaf=1; S(i).child_leaf=0; S(i).child_middle=0; S(i).child=[]; end sink.child=[]; sink.CHO=[]; sink.num_neighbor=0; sink.child_num=0; for i=1:1:node_number dis=sqrt((sink.x-S(i).xd)^2+(sink.y-S(i).yd)^2); if dis0&&disJ) j=1; rem_j(j)=randi(S(i).num_neighbor); while j