0
点赞
收藏
分享

微信扫一扫

【Spring框架全系列】如何创建一个SpringBoot项目

登高且赋 2023-05-09 阅读 80

    目录

💥1 概述

📚2 运行结果

🎉3 参考文献

👨‍💻4 Matlab代码

💥1 概述

​由于无线传感器网络中可能会出现覆盖漏洞,导致网络无法提供高质量的数据,所以需要检测边界节点以准确找到覆盖漏洞进行修复。已有研究大多是通过传感器的坐标或者依据大量节点信息进行检测,现提出算法通过检测每个节点的邻居节点是否能形成包围检测节点的闭合环来判别当前节点是否为边界节点。该算法使得节点能够仅基于小邻域的信息自主地决定它是否是边界节点,使其适用于节点分布不均匀的网络中。仿真实验验证了该算法在识别准确率、降低通信量等方面的有效性。

📚2 运行结果

主函数部分代码:

n = 500;
x = rand(n,1);
y = rand(n,1);
dt =  DelaunayTri(x,y);
figure(1);
triplot(dt);
​
vxlabels = arrayfun(@(n) {sprintf('o')}, (1:n)');
Hpl = text(x, y, vxlabels, 'FontWeight', 'bold', 'HorizontalAlignment',...
   'center', 'BackgroundColor', 'none');
[cc,r]= circumcenters(dt);
numtri = size(dt,1);
trilabels = arrayfun(@(x) {sprintf('*')}, (1:numtri)');
Htl = text(cc(:,1), cc(:,2), trilabels, 'FontWeight', 'bold', ...
   'HorizontalAlignment', 'center', 'Color', 'blue');
​
i = 0;
k = size(r,1);
rs=0.045; 
rc = 0;
ra = zeros(1,k);
​
for l=1:k 
    if ( cond1(r(l), rs) == 1 )
        x = cond2(dt, cc, l, rs);
        if x == 0 || x == 1 
            rc = rc+1;
            ra(rc) = l;
            circle(cc(l,1), cc(l,2), r(l));
        end;
    end;
end;
​
for l=1:rc
    
    x = dt.X(dt.Triangulation(ra(l),:), 1);
    y = dt.X(dt.Triangulation(ra(l),:), 2);
    
   xlabels = arrayfun(@(n) {sprintf('@')}, (1:3)');
Hp1 = text(x, y, xlabels, 'FontWeight', 'bold', 'HorizontalAlignment',...
   'center', 'BackgroundColor', 'none');
end;
figure(1);
​
figure(2);
​
for l = 1:n
    x= dt.X(l,1);
    y= dt.X(l,2);
    plot2(x,y,rs);
end;
for l=1:rc
    l1=ra(l);
    circle(cc(l1,1), cc(l1,2), r(l1));
    
end;
​
​
figure(2);
dt.Triangulation
dt.X

🎉3 参考文献

[1]张玖雅,卫琳娜.无线传感器网络中基于闭合环包围的边界节点检测[J].计算机应用研究,2020,37(08):2487-2490+2495.

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

举报

相关推荐

0 条评论