Research Article
A MAC Protocol of Concurrent Scheduling Based on Spatial-Temporal Uncertainty for Underwater Sensor Networks
Algorithm 1
Allocation process of the sending time.
Initialization: | 1: O(s)=null; | 2: P(r)={sink}; // the first parent node is sink node | Begin | 3: O(s)=P(r); | 4: While(x∈O(s) and x.attribute=true){ | 5: calculate Z(r)= {r|r is sub node of x node}; | 6: R(s)=Z(r)-O(s); | 7: pNode=sNode=x; | 8: pNode., flag=true; | 9: while( R(s)≠null and s.attribute=true){// Node s is not leaf node | 10: select j∈Z(r), calculatepNode; | 11: for each i∈Z(r)-{j} | 12: if (pNode;<) then, j=i; | 13: if (flag=true) calculate j.| pNode.; | 14: else calculate j.| sNode.; | 15: O(s)= O(s)∪{j}, R(s)=Z(r)-O(s); | 16: calculate j.; | 17: for each i∈R(s){ //look for concurrent sub nodes | 18: if (=) and (=) | 19: { O(s)= O(s) ∪{i}; | 20: R(s)=Z(r)-O(s); | 21: calculate i.; | 22:} | 23:} | 24: sNode=i; | 25: flag=! flag; | 26:} | 27:} End |
|