Algorithm 1 Stackelberg game resource pricing and allocation algorithm |
Input: Location: ; Computation amount: ; Iteration number: epoch |
Output: Price: ; Resource amount: ; Offload rate:
|
1: Simulation parameter initialized according to the distance relationships and computation amount. |
2: for episode = 1 to epoch do
|
3: for b = 1 to do
|
4: =; |
5: if and = =1 then
|
6: if
then
|
7: =; =; |
8: else
|
9: =; =; |
10: if and = = 1 then
|
11: =; =
|
12: else
|
13: if
then
|
14: =; =
|
15: for u = 1 to do
|
16: =
|
17: if
and = =1 then
|
18: if
then
|
19: =; =; |
20: else
|
21: =; =; |
22: for i = 1 to do
|
23: update by utility function according to ; |
24: update according to . |
25: record the utility of each player in this iteration. |
26: return and the final utility of each players. |