资源简介
DEEC分簇路由协议源代码,是一个多级的无线传感器网络路由协议,希望能帮助到大家
代码片段和文件信息
clear all
xm=100;
ym=100;
sink.x=0.5*xm; %location of sink on x-axis
sink.y=0.5*ym; %location of sink on y-axis
n=100 %nodes
P=0.1; %probability of cluster heads
Eo=0.5; %initial energy
ETX=50*0.000000001; %tx energy
ERX=50*0.000000001; %rx energy
Efs=10*0.000000000001; %free space loss
Emp=0.0013*0.000000000001; %multi path loss
%Data Aggregation Energy
EDA=5*0.000000001; %compression energy
a=1; %fraction of energy enhancment of advance nodes
rmax=5000 %maximum number of rounds
do=sqrt(Efs/Emp); %distance do is measured
Et=0; %variable just use below
A=0;
for i=1:1:n
S(i).xd=rand(11)*xm; %generates a random no. use to randomly distibutes nodes on x axis
XR(i)=S(i).xd;
S(i).yd=rand(11)*ym; %generates a random no. use to randomly distib
- 上一篇:simuli
nk仿真模型 - 下一篇:如何有效的应用MATLAB作图
评论
共有 条评论