How to avoid intersection of node in WSN node deployment.

I have created a WSN scenario and node deployment.But in real world no two WSN nodes can be in same position.how to avoid intersection of nodes.the code used for node deployment is given below.
for i = 1:numNode
% x coordination of node
nodeArch.node(i).x = rand * netArch.Yard.Length;
nodeArch.nodesLoc(i, 1) = nodeArch.node(i).x;
% y coordination of node
nodeArch.node(i).y = rand * netArch.Yard.Width;
nodeArch.nodesLoc(i, 2) = nodeArch.node(i).y;
% the flag which determines the value of the indicator function? Ci(t)
nodeArch.node(i).G = 0;
% initially there are no cluster heads, only nodes
nodeArch.node(i).type = 'N'; % 'N' = node (nun-CH)
nodeArch.node(i).energy = netArch.Energy.init;
nodeArch.node(i).CH = -1; % number of its CH ?
nodeArch.dead(i) = 0; % the node is alive
end

 採用された回答

KSSV
KSSV 2019 年 2 月 6 日

3 投票

Get the distance between the picked points and other points, you may use knnsearch or pdist, pdist2......if the distance is zero (or some tolerance) then the points are same.....as you know the indices..you can discard those points.

3 件のコメント

ALA SHARAF
ALA SHARAF 2019 年 2 月 6 日
Thank u sir.But rather than checking distance between points is zero i also need to check distance between points is greater than 5m.
KSSV
KSSV 2019 年 2 月 6 日
編集済み: KSSV 2019 年 2 月 6 日
I have already mentioned it....you can fix your tolerance value.
ALA SHARAF
ALA SHARAF 2019 年 2 月 6 日
OK Sir

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeWSNs についてさらに検索

質問済み:

2019 年 2 月 6 日

コメント済み:

2019 年 2 月 6 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by