## 4 Results
### Configuration of the Simulation Environment
#### 4.2.1 Configuration for Routing
Training of DNNs--The deep neural networks for predicting the wireless link lifetime and one-hop channel delay were implemented using TensorFlow version 2.11.0. The number of hidden layers or the number of neurons in each layer of a neural network cannot be determined computationally for a predictive modeling issue. Although we varied the number of neurons in the hidden layers from 10 to 10,000 and the number of hidden layers from 0 to 6, we observed the training curve for 25 epochs before deciding on the number of neurons per hidden layer and the total number of hidden layers. The best training curves were observed when the number of hidden layers was 2 and the number of neurons per hidden layer was 1024 for both wireless link lifetime and one-hop channel delay prediction models. Other hyperparameters for the DNNs were chosen systematically through testing and in accordance with prior research. Given that the output (wireless link lifespan or one-hop channel delay) is non-categorical (continuous) and positive, we used the Rectified Linear Unit (ReLU) as the activation function for both the inner layers and the output layer [71]. The loss function for the neural network is a mean squared error, as both problems are non-linear regression models [72]. Using the Adam optimizer with an \"Early stop callback\" to terminate training if the training loss fails to decrease during the past 3 epochs, we trained the DNNs at an initial learning rate of 0.0001 that deteriorated by 3 percent each epoch for 175 epochs. Systematic investigation (by watching the training curve for 25 epochs) also revealed an initial learning rate of 0.0001 and a learning rate decline rate of 3% each epoch. Usually, a batch size ranges from one to a few hundred. According to research carried out in [73], a decent default setting for batch size is 32. Therefore, during model training (fitting), we selected a batch size of 32. Furthermore, we shuffled the input and output data during model fitting to eliminate any bias, or, in other words, to prevent the model from learning the order of training [74]. Once the wireless link lifetime prediction DNN was trained, the optimization model for wireless link lifetime generation was replaced by the DNN for wireless link lifetime prediction. The predicted wireless lifetimes and one-hop channel delays were stored in replaceable CSV files to be read by the NS3 for generating the link lifetime and link delay matrices, in order to find the highest stable least delay / least distance path using the algorithm given in Figure 1.  
Scheduling Packet Transmissions  
For routing experiments, we sent \(x\) packets, each of payload size 104 bytes, consisting of status data (node addresses, acceleration, velocity, position, timestamp) from each and every node in the network to pseudo-random destination nodes, determined using Equation (44). \(x\) varied from 1 to 5, in order to have different levels of queuing delay in the network where \(x\) was decided, as given in Equation (43):  
\[x=\left\{ \begin{array}{l}ceil((M\ mod\ 50)/10);\ \ if\ (M/50)\ mod\ 2==0\\ -ceil((M\ mod\ 100)/10)+10;\ \ if\ (M/50)\ mod\ 2==1\end{array} \right. \tag{43}\]  
In Equation (43), \(x\) is the number of packets sent by a given source node, \(M\) is the routing cycle number, and \(mod\) is the modulus operation. The destination node ID \((d_{si}(t))\) for the \(i\)th data packet transmitted from the source node ID (\(s\)) can be stated as shown in Equation (44):  
\[d_{si}(t)=(r(t)+s+i)\ mod\ N \tag{44}\]  
In Equation (44), \(r(t)\) is the random number at time \(t\), \(mod\) is the modulus operation, and \(N\) is the total number of nodes. The current simulation time (\(t\)) is provided as the seed for the random number generator, such that, for a given simulation time, the destination node IDs will be constant among different simulation runs.