|
Algorithm 1: RL-Based Routing with Entropy & Gini Reward |
| Input: Current Node
|
| Output: Next Hop
|
| 1: // |
| 2: // Action Selection (Epsilon-Greedy) |
| 3:
|
| 4:
|
| 5:
|
| 6: // Reward Calculation (Core Innovation) |
| 7: using Equations (23) and (24) |
| 8:
based on Entropy Equation (27) & Gini Equation (28) |
| 9:
|
| 10: // Update Q-Value |
| 11:
|