27-02-2016, 04:50 PM
%Field Dimensions - x and y maximum (in meters)
xm=100;
ym=100;
%x and y Coordinates of the Sink
sink.x=50;
sink.y=50;
%Number of Nodes in the field n=100;
%Optimal Election Probability of a node %to become cluster head
p=0.1;
%Energy Model (all values in Doules)
%Initial Energy Eo=0.5;
%Eelec=Etx=Erx ETX=50*0.000000001;
ERX=50*0.000000001;
^Transmit Amplifiers types Efs=10*0.000000000001;
Emp=0.0013*0.000000000001;
%Data Aggregation Energy EDA=5*0.000000001;
ydl=33;
%Values for Fletereogeneity %Percentage of nodes than are advanced m=0.1;
%\alpha times advance nodes have energy greater than normal nodes a=2;
^Computation of do do=sqrt(Efs/Emp);
Et=0;
%Creation of the random Sensor Network
%figure(l);
for i=l:l:n
S(i).xd=rand(ljl)*xm; XR(i)=S(i).xd;
S(i).yd=rand(ljl)*ym; YR(i)=S(i).yd;
S(i).G=0;