How to find minimum distance gateway node from a cluster head?

1 Ansicht (letzte 30 Tage)
Rohini Sharma
Rohini Sharma am 30 Apr. 2015
Hello every body.
I have a sensor network of 100 sensor nodes. sink.x=50; sink.y=120;
for i = 1 : 1 :n
S(i).xd = rand(1,1)*xm ;
S(i).yd = rand (1,1)*ym ;
xd(i) = S(i).xd ;
yd(i) = S(i).yd ;
S(i).id = i;
S(i).type = 0;
S(i).g = 0 ;
S(i).E = Eo ;
S(i).type = 0 ;
% plot(S(i).xd, S(i).yd , 'o' )
% grid on ;
% hold on ;
% figure(1);
end
Next I have a set of 16 gateway nodes. Placed as follows
for i=1:1:16
Sg(i).xd= 2+100*rand(1,1);
Sg(i).yd=100;
xd(i)=Sg(i).xd;
yd(i)=Sg(i).yd;
Sg(i).id=i;
plot(Sg(i).xd,Sg(i).yd,'*k')
grid on;
hold on;
end
I have to form cluster heads from these sensor nodes using LEACH protocol. After the creation of cluster heads, I have to connect a gateway node with every cluster head. Condition gateway node should be at minimum distance from cluster head.
Please reply.
I know LEACH code. But no able to connect gateway node with min distance CH.
Thanks

Antworten (0)

Kategorien

Mehr zu WSNs finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by