目录
💥1 概述
📚2 运行结果
🎉3 参考文献
👨💻4 Matlab代码
💥1 概述
提高能源效率是无线传感器网络面临的关键挑战之一,无线传感器网络日益普遍。由于节点(传感器)通常不得不依赖有限的能量存储来执行其数据收集工作,作为对来自其他节点的数据的中继,因此数据传输路径的优化对于提高网络寿命变得很重要。将节点分组到具有簇头(CH)的簇中是实现这一点的常见方式。
然而,节点作为数据收集器和数据中继的两个角色在能耗方面相互冲突;随着数据中继操作(整个网络正常运行所必需的)深入有限的能量存储,它可能会缩短节点的寿命,阻碍其数据收集。自我生存和对网络的贡献之间的这种内在冲突,为博弈论在传感器网络建模中的应用开辟了有趣的途径。本文提出了一个这样的模型——DEGRA,并与其他模型(即LEACH和DEER)进行了比较。该算法通过考虑所讨论的节点以及周围节点的剩余能量来实现这一点。
📚2 运行结果



主函数部分代码:
1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   Energy Density Based Algorithm Proposed                            %
%                                                                      %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Field Dimensions - x and y maximum (in meters)
xm = 100;
ym = 100;
%x and y Coordinates of the Sink
%sink.x =0.5 * xm;
%sink.y = ym + 50;
%sink.x=50;
%sink.y=175;
sink.x = -100;
sink.y = -100;
%sink.x=0.5*xm;
%sink.y=0.5*ym;
%Number of Nodes in the field
n = 100;
%Optimal Election Probability of a node to become cluster head
%p=0.05;
PacketLength =4000;
ctrPacketLength = 125;
%Energy Model (all values in Joules)
%Initial Energy
Eo = 0.25;
%Eelec=Etx=Erx
ETX=50*0.000000001;
ERX=50*0.000000001;
%Transmit Amplifier types
Efs=10*0.000000000001;
Emp=0.0013*0.000000000001;
%Data Aggregation Energy
EDA=5*0.000000000001;
INFINITY = 999999999999999;
%maximum number of rounds
rmax=3000;
%%%%%%%%%%%%%%%%%%%%%%%%% END OF PARAMETERS %%%%%%%%%%%%%%%%%%%%%%%%
%Computation of do
do=sqrt(Efs/Emp);
%Creation of the random Sensor Network
figure(1);
for i=1:1:n
    S(i).xd(1) = rand(1,1)*xm;%×ø±ê
    %XR(i)=S(i).xd;
    S(i).yd(1) = rand(1,1)*ym;
    %YR(i)=S(i).yd;
    %S(i).G = 0;
    %initially there are no cluster heads only nodes
    S(i).type(1) = 'N';
    S(i).E(1) = Eo;
    %S(i).ENERGY(1) = 0;
    % hold on;
    plot (S(i).xd,S(i).yd,'og')
    hold on;
end
S(n+1).xd(1) = sink.x;
S(n+1).yd(1) = sink.y;
%plot(S(n+1).xd, S(n+1).yd, 'x')
hold on;
%First Iteration
figure(1);
%counter for CHs
countCHs=0;
%counter for CHs per round
rcountCHs=0;
cluster=1;
countCHs;
rcountCHs=rcountCHs+countCHs;
flag_first_dead=0;
TOT_ENERGY_INIT(1).E = 0;
for i = 1:1:n
    if (S(i).E(1)>0)
        TOT_ENERGY_INIT(1).E = TOT_ENERGY_INIT(1).E + S(i).E(1);
    end
end
 
 
🎉3 参考文献
[1]王超. 无线传感器网络中数据收集方法研究[D].北京邮电大学,2012.
部分理论引用网络文献,若有侵权联系博主删除。


















