Research Article
Energy-Efficient Resource Allocation for NOMA-Enabled Internet of Vehicles
Algorithm 1
DRL-based resource allocation algorithm.
1: Initialize the network weight parameters | 2: Initialize the actor and critic network weight parameters and | 3: Initialize the weight parameters of the target network , target actor network , and target critic network | 4: Initialize replay memory and event trigger block | 5: for, M do | 6: Initialize random noise | 7: Initialize the state of the NOMA-enabled IoV system | 8: for, do | 9: Calculate the difference between and according to Equation (19) | 10: if then | 11: Select action according to the DQN method | 12: Select action according to the DDPG method | 13: Replace and in the event trigger with and | 14: else | 15: Output the action | 16: end if | 17: Perform , get reward and new state | 18: Store sample into replay memory | 19: Sampling samples from replay memory | 20: Update the network, actor network, and critic network weight parameters , , and | 21: Update the target network, target actor network, and target critic network weight parameters , , and | 22: end for | 23: end for |
|