Skip to main content
. 2022 Sep 7;22(18):6760. doi: 10.3390/s22186760
Algorithm 1: Service Caching Algorithm based on Gibbs Sampling
Input:N, , S, Ds(sS), Km(m), w
Output:C, X, , τ, τave
1: Initialize C00, L
2: for l=1:L do
3: Randomly select an MEC server m and a feasible caching strategy Cm*C;
4: Based on the previous round caching strategy {C1l1,C2l1,CMl1}, compute the task offloading strategy X and resource allocation strategy and objective function value τ and τave;
5: Based on the current round caching policy {C1l,C2l,Cm*,CMl}, compute the task offloading strategy X* and resource allocation strategy * and objective function value τ* and τ*ave;
6: Let Cml=Cm* with the probability ρ=11+e(ττ)/w;
7: Let Cml=Cml1 with the probability 1ρ;
8: end for