Skip to main content
. 2024 Dec 17;24(24):8046. doi: 10.3390/s24248046
Algorithm 1 Resource Predictive Load Balancing SFC Migration Algorithm (RP-LBM)
1 Input: Prediction result cj,unf(t+n),  mj,unf(t+n)(n=1,2,); Physical network diagram G=(Vs,Es); SFC network diagram Ginf=(Vinf, Einf)
2 Output: SFC mapping strategy π;
3 Calculate the resource utilization ηR of each physical node according to the prediction result;
4 if ηR  throver then
5   Select an SFC to migrate on that node;
6   Initialize (θc, θa),Kmax, M, ((εc, εa));
7   for episode = 1, …, M do
8     Select mapping actions a(t) from the strategies π(sn(t)|an(t),θan);
9     if constraints are satisfied then
10       Execute the action a(t), get the instantaneous reward
11       r(t) and transfer it to the state s(t+1);
12       Obtain the advantage function A(sn(t),an(t));
13     else
14     Set instantaneous reward r(t) = 1/ε, and re-select the action a(t) from the policy network;
15     end if
16     Compute the clipped surrogate objective for PPO
17     Update the policy parameters θa using gradient ascent
18     Update the value function parameters θc using gradient descent
19   end for
20 end if