Skip to main content
. 2021 Jan 13;21(2):534. doi: 10.3390/s21020534
Algorithm 1 Pseudo-code of Greedy Based Algorithm for Time Sequence Resource Allocation
  • 1:

    Initialization of parameters

  • 2:

    whileI(k)do

  • 3:

         Calculate the differential objective function ΔS towards k UAV with the closest link opportunity in the time domain.

  • 4:

         Select a flexible threshold value Th=ϵ·max(ΔS(l,s)) according to the maximum value of objective functions.

  • 5:

         Find link opportunities for each UAV that satisfies ΔS>=Th.

  • 6:

         if Only one UAV is allocated to this opportunity then

  • 7:

             Save link opportunity T to kth UAV.

  • 8:

             Remove elements in I(k) when Te(I(k))<=T(s).

  • 9:

             Update parameters.

  • 10:

         else

  • 11:

             Save link opportunities T with the maximum ΔS value to kth UAV.

  • 12:

             Remove elements in I(k) when Te(I(k))<=T(s).

  • 13:

             Update parameters.

  • 14:

         end if

  • 15:

    end while

  • 16:

    returnT