Skip to main content
. 2020 May 27;20(11):3034. doi: 10.3390/s20113034
Algorithm 2 Prioritized-based contact-duration frame selection mechanism (PCdFS) Algorithm.
Input: Initial deployed information of nodes and UAVs, SkB1, SkB2, Np, Nnode.
Output:Np, Nnode
  1: for SiSkB1, SjSkB2 do
  2:        Make a judgement for sensor Si and Sj: which priority area does them in;
  3:        Calculate the contact duration between Si and the UAV1, Sj and the UAV2, respectively;
  4: end for
  5: For UAV1 (and UAV2), tk allocated to the one (e.g., Sik, and SikSkB1 for UAV1, and Sjl, SjlSkB2 for UAV2) which is within the higher priority area; When more than one node within the same high priority area, tk allocated to the one (e.g., Sik for UAV1, and Sjl for UAV2) which has the shorter contact duration with the UAV.
  6: In tk, Sik and Sjl send packets to UAV1 and UAV2 respectively;
  7: Update Np, Nnode;
  8: return Np and Nnode;