# Task Offloading Based on Lyapunov Optimization for MEC-Assisted Vehicular Platooning Networks
## 6 Simulation Results
### Performance Analysis  
Figure 4 shows the relationship between average queue length and time. From the simulation results, it can be seen that the average length of each queue increases rapidly with time, then slowly tends to be flat until it reaches a stable state. The queue length is related to the size of computation resources corresponding to queue, and the larger the computation resources provided, the smaller the queue length. Figure 5 shows the variation of average energy consumption with time. \(V\) is an important parameter to control the energy consumption of the whole system. As the value of \(V\) increases, the energy consumption decreases because \(V\) indicates the importance attached to energy consumption. According to the optimization function Formulation (20), the larger the value of \(V\), the greater the proportion of energy consumption in the entire optimization function. In addition, we set the value of \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter Name** & **Value** \\ \hline Number of PMs & \(M\) = 5 \\ Data transmission power & \(p_{tr}\) = 0.1 W \\ Computation power & \(p_{c}\) = 0.5 W \\ Idle power & \(p_{i}\) = 0.001 W \\ The distance between adjacent vehicles & 8 m \\ V2V communication bandwidth & \(w_{1}\) = 100 MHz \\ V2I communication bandwidth & \(w_{2}\) = 20 MHz \\ Noise power density & \(-\)174 dBm/Hz \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Simulation parameters. Figure 4: Average queue length vs. time. \(V\) to 1000 in this system, which is an optimal value. Further increasing the value of \(V\) will not affect the energy consumption because the proportion of energy consumption in the whole optimization function is much larger than other items. Figure 6 shows the effect of deadline \(T_{d}\) on average queue length of task computation. The minimum deadline that the system can meet is 0.12 s. If the deadline is less than 0.12 s, some tasks cannot be completed. When 0.12 s \(<T_{d}<\) 0.9 s, some tasks will be offloaded to another queue to ensure the completion of the tasks because the resources of the PM cannot meet its task requirements. When \(T_{d}\) > 0.9 s, the queue length will not change with \(T_{d}\) because all tasks can be completed within 0.9 s. In addition, the queues of MEC server and PM 5 show a downward trend because the computation resources they provide are large enough, and these two queues can meet more task offloading requirements. However, due to the smaller computational resources provided by other queues, fewer and fewer tasks are offloaded to PM 1, 2, 3, and 4 in order to meet the offloading demand as the deadline \(T_{d}\) falls continuously. Therefore, the average queue length of their task computation size will be shorter and shorter as \(T_{d}\) decreases. In Figure 7, the energy consumption fluctuates greatly with \(T_{d}\) when the value \(V\) is small, while, when the value of \(V\) is large, the fluctuation of energy consumption is relatively stable. Because in the optimization function Formulation (20), when \(V\) = 10, the value of the whole penalty item is about 0.01 times of the value of other items, so the proportion of the whole penalty item is relatively small, and the fluctuation is also relatively large. However, when \(V\) = 1000, the penalty term accounts for the vast majority of the entire optimization function, and the energy consumption changes dominate, so the energy consumption fluctuation tends to be stable when the \(V\) value is large enough. Figure 5: Average total energy consumption vs. time. Figure 6: Task computation average queue length vs. deadline. To verify the effectiveness of the proposed algorithm, it is compared with the following two schemes: (1) the shortest queue waiting time algorithm, where \(t_{d}^{k}=Q_{k}/f_{k}\) indicates the waiting time of the queue \(k\), and the shortest queue waiting time algorithm indicates that the minimum value of all queue waiting times is treated as the deadline of all tasks; (2) all tasks are offloaded to the MEC server for execution.