Research Article

Intelligent Channel Allocation for Age of Information Optimization in Internet of Medical Things

Algorithm 1

Channel allocation algorithm for user j based on DQN
Input: Node list, gateway list
Initialization:
 1. Initialize cost and energy to 0.
 2. Initialize step to 1.
For episode =1 to maximum iteration time T do
 Count =1;
 Obtain state based on the input.
 1. Repeat:
  (1) Select action
  (2) Output the next state , reward , cost and energy according to the count and action
  (3) Store transition (, , , ) in the replay memory
 2. If step >200 and step % 5 == 0:
  Sample random minibatch of transitions (, , , ) from the replay memory pool.
Else:
  Continue
 3. Update:
   ;
   += ;
   +=;
  Step + =1;
  Count + =1;
  For each node in node list
   If packet size <= 0:
    Break
 4. Update target value .
 5. Perform a gradient descent step on .
 6. Reset for every Z steps.
End for