Research Article
Deep Reinforcement Learning-Based Task Offloading for Parked Vehicle Cooperation in Vehicular Edge Computing
Algorithm 1
The optimal resources allocation.
(1) | Input the set of tasks T, the maximum resources can be assigned to each task rmax, and the total available resources of the parking cluster . | (2) | use R as the current available computing resources of the parking cluster, initialize R = . | (3) | while do | (4) | if R > 0 then | (5) | for each task i in set T do | (6) | for each m (m ≤ rmax and m < R) do | (7) | Select the i and m with minimized , denoted as i0 and m0 | (8) | end for | (9) | end for | (10) | else | (11) | break; | (12) | allocate m0 resources to task i0 | (13) | T: = T − i0 | (14) | R: = R − m0 | (15) | end if | (16) | end while |
|