主题:matlab的应用
算法的相关数据结构和算法伪代码如图所示
数据结构
Properties:
The number of the nodes in the area: Num
The fixable distance between two nodes:
The maximum distance the node could move:
The threshold of the coverage:
图3-4 数据结构
算法伪代码
For loop=1:MAXLOOP
% coverage evaluation
calculate the coverage of the area;
if( )
break;
end
%virtual forces among nodes
for =1:Num
for =1:Num
if ( )
calculate the Euclid distance between the sensors :
calculate the virtual force using , ,
end
end
calculate the distance of the node to move using
% moves the nodes
if ( > )
moves to its maximum distance
else
moves to its next position
end
end
end
图3-5 算法伪代码
数据结构
Properties:
The number of the nodes in the area: Num
The fixable distance between two nodes:
The maximum distance the node could move:
The threshold of the coverage:
图3-4 数据结构
算法伪代码
For loop=1:MAXLOOP
% coverage evaluation
calculate the coverage of the area;
if( )
break;
end
%virtual forces among nodes
for =1:Num
for =1:Num
if ( )
calculate the Euclid distance between the sensors :
calculate the virtual force using , ,
end
end
calculate the distance of the node to move using
% moves the nodes
if ( > )
moves to its maximum distance
else
moves to its next position
end
end
end
图3-5 算法伪代码