Skip to main content
. 2018 Sep 17;18(9):3140. doi: 10.3390/s18093140
Algorithm 1 Proposed ECM-RMA algorithm
Input: Q(t),E(t),Bm,ul,hm,ul(t),w0,fmn(t),Lm(t),T,mM,nN
Output: p(t),τ(t),e(t),Q(t+1),E(t+1)
1: / Transmission Power and Transmission Time Allocation /
2: for mM do
3:     for nN do  
4:         Solve the standard convex optimization problem in (35) to acquire the optimal power and time allocation policy;  
5:     end for
6: end for 
7: / Battery Management / 
8: formMdo  
9:     if Em(t)<Ω then
10:         em,w(t)=max{ΩEm(t)γm(t),0};
11:         m(t)=TnNτmn(t);
12:         m(t)=min{m,em,w(t)μpap(t)hm,dl(t)};
13:         em,w(t)=μpap(t)hm,dl(t)m(t);
14:     else 
15:         em,w(t)=0
16:     end if 
17: end for 
18: / Update the Queue Length /
19: for mM do
20:     Compute Em(t+1) based on Equation (11);  
21:     for nN do
22:         Compute Qmn(t+1) based on Equation (14);  
23:     end for 
24: end for