Skip to main content
. 2022 May 19;22(10):3854. doi: 10.3390/s22103854
Algorithm 1 Stackelberg game resource pricing and allocation algorithm
Input: Location: bs,uav,user; Computation amount: Di; Iteration number: epoch
  Output: Price: Mig,Mjg,mij; Resource amount: Fig,fij; Offload rate:γil,γig,γij,γir
1: Simulation parameter initialized according to the distance relationships and computation amount.
2: for episode = 1 to epoch do
3:  for b = 1 to bsnum do
4:   Fig=Di·γig+γir;
5:   ifγig0 and Needig= =1 then
6:    if minMig2MigmaxMig then
7:      Mig=2·Mig; Mi,lowg=Mig;
8:   else
9:    Mi,highg=Mig; Mig=Mi,highg+Mi,lowg2;
10:   ifγir0 and Needig = = 1 then
11:    Mj,highg=Mjg; Mjg=Mj,highg+Mj,lowg2
12:   else
13:    if minMjg2MjgmaxMjg then
14:      Mj,lowg=Mjg; Mjg=2·Mjg
15:  for u = 1 to uavnum do
16:   fij=Di·γij
17:   if γij0 and Needij= =1 then
18:    if minmig2migmaxmig then
19:      mig=2·mig; mi,lowg=mig;
20:   else
21:    mi,highg=mig; mig=mi,highg+mi,lowg2;
22:  for i = 1 to usernum do
23:   update γil,γig,γij,γir by utility function according to Mig,Mjg,mij,Fig,fij;
24:   update Needig,Needij according to γil,γig,γij,γir.
25:  record the utility of each player in this iteration.
26: returnMig,Mjg,mij,Fig,fij,γil,γig,γij,γir and the final utility of each players.