Skip to main content
. 2024 Feb 29;24(5):1599. doi: 10.3390/s24051599
Algorithm 1 A MAB-based fair scheduling algorithm for reducing energy consumption.
  • Initialize: 

    global model w0; M terrestrial devices indexed by m, each with a local data volume of Dmt in round t;

  • Output: 

    global model wT

  •   1:

    TheUAV:

  •   2:

    Initialize global model w0

  •   3:

    for each round t=1 to T do

  •   4:

       St← ClientSelection(t, N),St=N

  •   5:

       Receive the trained local models wmt from the terrestrial device in the set St

  •   6:

       Aggregate the models uploaded according to Equation (2)

  •   7:

       Send wt to M terrestrial devices

  •   8:

    end for

  •   9:

    TheterrestrialdeviceUm:

  • 10:

    Receive the global model wt from the UAV

  • 11:

    for each local round l=1 to T do

  • 12:

      Train the local model wmt according to Equation (1)

  • 13:

    end for

  • 14:

    Send wmt to the UAV

  • 15:

    ClientSelection(t,K,N):

  • 16:

    Initialize the relevant parameters to ensure that the reward distribution is unknown

  • 17:

    Update the reward function according to Equation (15) and also update the UCB score according to Equation (16)

  • 18:

    Sort the UCB scores of individual terrestrial devices in descending order

  • 19:

    Select the first N terrestrial devices to form St, i.e., St=argmaxStUCBm,t

  • 20:

    Return St to the UAV