异构无线传感器网络路由算法研究(Matlab代码实现)

    目录

💥1 概述

📚2 运行结果

🎉3 参考文献

👨‍💻4 Matlab代码

💥1 概述

​无线传感器网络(Wireless Sensor Networks, WSN)是一种新型的融合传感器、计算机、通信等多学科的信息获取和处理技术的网络,其在工业和军事领域具有广泛的应用前景。目前对于WSN的研究主要局限于同构WSN领域,与同构WSN不同,异构传感器网络中的传感器节点拥有不同的资源配置,如计算能力、通信能力、存储能力、电源能量等,更能满足实际应用场景对WSN的需求,因此设计合理的基于异构传感器网络的路由协议成为异构传感器网络领域的主要研究问题之一。 

📚2 运行结果

主函数部分代码:

clc;
clear all;
close all;
 
% Simulation Parameters
 
%Field dimensions in meters
xm = 200;
ym = 200;
 
%initial x and y coordinates of the Sink
sink.x = 0;
sink.y = ym*0.5;
 
%Number of Nodes in the field
n = 600;
 
%Optimal Election Probability of a node
%to become cluster head
p_opt = 0.1;
 
L = 4000;   % packet length
 
%Energy Model
Eo = 0.5;                      %Initial Energy
E_elec=50*0.000000001;         % energy consumed by radio electronics in transmit/receive mode(J/bit)
E_fs=10*0.000000000001;        %energy consumed by the power amplifier on the free space model(J/bit/m2)
E_mp=0.0013*0.000000000001;    %energy consumed by the power amplifier on the multi path model(J/bit/m4)
E_DA=5*0.000000001;            % energy consumed for data aggregation(J/bit/signal)
 
INFINITY = 999999999999999;
 
%maximum number of rounds
rmax=15000;
 
%threshold distance
do= 70;
 
m = 0.75;
a = 2;
m0 = 0.525;
b = 2.5;
m1 = 0.225;
u = 3;
 
c=0.02;
z=0.71;
T_absolute= z*Eo;
 
cr=5;                      % compression ratio
 
S = struct;
S.xd = zeros(n,1);
S.yd = zeros(n,1);
S.E = zeros(n,1);
S.type = zeros(n,1);
S.G = zeros(n,1);
S.CH = zeros(n,1);
S.D = zeros(n,1);
S.T = zeros(n,1);
S.min_dis_cluster= zeros(n,1);
S.dis_to_cluster= zeros(n,1);
 
C = struct;
C.id= zeros(25,1);
C.xd= zeros(25,1);
C.yd= zeros(25,1);
C.E= zeros(25,1);
C.member= zeros(25,1);
 
R = struct;
R.id= zeros(100,1);
R.xd= zeros(100,1);
R.yd= zeros(100,1);
 
p = zeros(n,1);
E = zeros(n,1);
DEAD = zeros(rmax,1);
RES = zeros(rmax,1);
 
% Creation of four-level heterogeneous network 
% Normal Nodes
for i=1:1:240
    S(i).xd = xm*rand(1,1);
    S(i).yd = ym*rand(1,1);
    S(i).E = Eo;
    S(i).type = 'N';
    S(i).G = 1;
    S(i).CH = 0;
    S(i).D = 0;
    S(i).R = 0;
    S(i).min_dis_cluster=0;
    S(i).dis_to_cluster=0;
    figure(3);
    plot(S(i).xd,S(i).yd,'o', 'MarkerSize', 3, 'MarkerFaceColor', 'g');
    hold on;
end

🎉3 参考文献

[1]王若霖. 基于群智能算法的异构WSN节点部署优化研究[D].哈尔滨工程大学,2020.

部分理论引用网络文献,若有侵权联系博主删除。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值