Skip to main content
. 2018 Sep 30;18(10):3291. doi: 10.3390/s18103291
Algorithm 1. The optimal mode selection
1: Initialize system parameters such as T, fop, Rth, K, B, PAP, F0, α, Mc, N0, ξ,
2: Calculate optimal τipt(local)* according to Lemma 1,
3: Calculate optimal ρ(local)* and τcpt* according to Theorem 1,
4: Calculate the minimal energy requirement (i.e., Eu(local)) by substituting τipt(local)*, ρ(local)*, and τcpt* into the
     objective function of Problem P1,
5: Calculate optimal τipt(offload)* according to Theorem 2 by using the bisection method,
6: Calculate optimal ρ(offload)*, τuf*, and Puf* based on τipt(offload)* according to Theorem 1,
7: Calculate the minimal energy requirement (i.e., Eu(offload)) by substituting τipt(offload)*, ρ(offload)*, τuf*, and Puf*
     into the objective function of Problem P2,
8: Compare Eu(local) with Eu(offload)
                If Eu(local)Eu(offload), then trigger the local computing mode,
                Otherwise, trigger the fog computing mode.