| //initialization |
| ; |
| Set relevant parameters and coefficients; |
| Set the max cycle-index ; |
| While () do |
| { |
| Renew the neighbor nodes set of node ; |
| Read the current coordinate position of node ; |
| Read all neighbor nodes of node ; |
| Calculate resultant force to node according to formulas |
| (8)(13); |
| Calculate the target position of node at time |
| according to formulas (14) and (15); |
| Calculate the coverage rate of this movement and rotation |
| according to formula (2); |
| Determine the mode of movement according to the |
| coverage rate. Calculate influence factors . And determine |
| the final moving direction of the node. |
| If , move node according to the mode and direction |
| in step , or keep the current position of node unchanged. |
| ; |
| } |
| End. |