Research Article

Joint Optimization of Resources in Fog-Radio Access Network with Binary Computation Offloading

Algorithm 2

The DDQN algorithm.
Input: Number of UEs , size of tasks and distance between UE and F-AP ;
Output: Suboptimal decision ;
(1)Initialization: Initialize the parameter of the main network with random weight and the parameter of the target network with random weight and empty the public experience pool;
(2) Set training interval ;
(3)for to do
(4)  Reset starting environment information ;
(5)  for to do
(6)   Reset remaining channel resources and remaining fog computation resources ;
(7)   for to do
(8)    The main network generates action with the -greedy method according to ;
(9)    Map to subactions and implement them in the environment;
(10)    Obtain status and reward based on the environmental changing ();
(11)    Mark and store it in the public experience pool;
(12)    if (the public experience pool is full) then
(13)     The target network calculates ;
(14)     Update the main network parameter based on and replace the oldest data with the new one;
(15)    end if
(16)    while (episode mod ) do
(17)     Assign the main network parameters to the target network, i.e., ;
(18)    end while
(19)   end for
(20)  end for
(21)end for
(22) The target network picks the action with the smallest ) as the suboptimal decision : .