Skip to main content
. 2019 Sep 19;19(18):4049. doi: 10.3390/s19184049
Algorithm 3: Computing the Reward
Create Supply Curve for {[Nactual], r} from Historical Dataset //Create Supply Curve.
Mpredict = Linear Regression Model for Supply Curve {[Nactual], r}//Construct Linear Regression model.
 [r] = 0..rmax //Predict the responses for different reward levels.
[Npredict,r] = predict(Mpredict, [r]])
foreach r //Construct the each reward’s queuing state variables.
    Zforfeit(t)= Npredict(t)  Ndesired(t)
    {[r, Npredict(t),Zforfeit(t))] }+ [r, Npredict(t), Zforfeit(t))]
end foreach
Bconstant(t)= 0.5 * (Nreceived(t1)  Ndesired(t))2//Compute Lyapunov Optimization constant.
V = [U,V] //Map data utility weighting U to V
foreach [r, Npredict(t), Zforfeit(t))] //Use Lyapunov Optimization to evaluate each reward.
   B(t) = r * Npredict(t)//Compute the budget used by this reward.
       if B(t) > Bproportionmax then //Check that budget consumption does not exceed set maximum.
       break
   end if
   L = ½ * Zforfeit(t)2//Carry out the Lyapunov Optimization computation.
   Δ(t) = L Llast(r)//Compute one-slot conditional Lyapunov drift.
   DPPLHS = Δ(t) + (V * B) //Evaluate drift plus penalty expression.
   DPPRHS= Bconstant(t) + (V * B) + Z(t)(Nreceived(t1) Ndesired(t)))
   if  DPPLHS >= DPPRHS then
      continue
   end if
   OPTcurrent= Npredict * ((V * r) + Z(t))//Evaluate the current optimization computation.
   if OPTcurrent> OPTsolution then
      OPTsolution= OPTcurrent
      roptimal=r
   end if
end foreach