|
Algorithm 1 Node assignment algorithm |
| 1: |
For each | //collect all the nodes whose aggregation queue is ready to aggregate. |
| 2: |
If
or
then
|
| 3: |
|
| 4: |
End if
|
| 5: |
End for
|
| 6: |
Ifthen//if , no node in send the aggregation queue. |
| 7: |
Return
|
| 8: |
End if
|
| 9: |
For each //collect all the nodes whose . |
| 10: |
If
then
|
| 11: |
|
| 12: |
End if
|
| 13: |
End for
|
| 14: |
For each from with max to with min in //assign to with the priority of large to small. |
| 15: |
While
then //assign with sufficient aggregation queues to make the node aggregate. |
| 16: |
|
| 17: |
|
| 18: |
End while
|
| 19: |
|
| 20: |
End for
|
| 21: |
Ifthen//the remaining queues of nodes in are transmitted to . |
| 22: |
While
then
|
| 23: |
|
| 24: |
|
| 25: |
End while
|
| 26: |
End if
|