Skip to main content
. 2020 May 27;20(11):3034. doi: 10.3390/s20113034
Algorithm 1 Balance Algorithm.
Input: Initial deployed information of nodes and UAVs
Output:Np, Nnode
  1: Np = Nnode = 0, k = 1, Tnow = 0;
  2: Step 1. Synchronization;
  3: UAV sends k-th ’Beacon’ message;
  4: Network update, obtain the SkB1 and SkB2;
  5: Step 2. Data Communication;
  6: while Tnow<T do
  7:        Let SkB1,2SkB1SkB2, SkB1,oSkB1SkB1,2, and SkB2,oSkB2SkB1,2;
  8:        if SkB1,2 = ⌀ then
  9:                Apply PCdFS mechanism (Algorithm 2) to balance the communication between SkB1,o and UAV1, SkB2,o and UAV2 respectively;
10:        else
11:                Apply PMCdFS algorithm (Algorithm 3) for the balancing between mobile nodes in SkB1,2 and multi-UAVs, and obtain SkB1 and SkB2 through PMCdFS algorithm;
12:                Apply PCdFS mechanism (Algorithm 2) to balance the communication between SkB1,o and UAV1, SkB2,o and UAV2 respectively;
13:        end if
14:        Update Tnow, k, Np and Nnode;
15: end while
16: return Np and Nnode;