## 4 Results and Discussion  
### Network Training  
The number of vehicles and pedestrians, along with their respective speed values, were derived from previous traffic studies and experiments conducted in the city of Lisbon. Using this empirical data as a foundation, we simulated 2600 vehicles and 2000 pedestrians over the course of one hour to represent a typical peak-hour scenario in an urban environment. The learning rate was selected to balance convergence speed and stability, following guidelines from foundational work on reinforcement learning and optimization. Preliminary experiments were conducted to identify the optimal range, ensuring that the model avoided divergence or excessively slow training [22; 24]. This approach ensures that the experimental conditions closely align with real-world traffic patterns while providing a controlled environment for our analysis, with aligns our parameter tuning with practices in mixed traffic flow analyses and provides insights into dynamic parameter optimization in traffic signal control [30; 31]. So, to compare both scenarios, three neural networks were trained with a reward function of 50/50, this being the weight for vehicles and pedestrians, respectively. The environment simulated 2600 vehicles and 2000 pedestrians over 300 episodes, each lasting 3600 s. The batch size was tuned to balance computational efficiency and the stability of gradient updates. Smaller batch sizes provided better generalization for our traffic scenarios, while larger sizes caused slower response to changing dynamics. Training parameters are given in Table 2.  
Figure 9: A schematic of the state representation for each junction. The three neural networks utilized in the comparison are based on a Feed Forward Neural Network (FFNN) architecture, structured as follows:  
* _Input Layer_: 164 neurons, representing the current state of the environment. * _Hidden Layers_: Five fully connected hidden layers, each utilizing the ReLU activation function for non-linearity. * _Output Layer_: 9 neurons, each corresponding to a discrete action that the agent can take in the environment. This choice of architecture was made to balance computational efficiency with sufficient model complexity to capture the dynamics of the traffic environment. To analyze the results obtained, Figure 9(a) presents the cumulative negative reward graph, where significant differences can be observed among the curves for the three training scenarios. In the arterial scenario, the system faces a higher volume of bidirectional traffic flow, resulting in a lower reward compared to the other scenarios. This is attributed to the increased traffic volume creating substantial pressure at each junction, leading to longer waiting times and larger queues. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Number of Episodes & 300 \\ \hline Max Steps & 3600 \\ \hline Vehicles Generated & 2600 \\ \hline Pedestrians Generated & 2000 \\ \hline Hidden Layers & 400 \\ \hline Activation Function & ReLu \\ \hline Width Layers & 400 \\ \hline Batch Size & 100 \\ \hline Learning Rate & 0.001 \\ \hline Training Epochs & 800 \\ \hline Memory Size & 50,000 \\ \hline Number of States (Input Layers) & 164 \\ \hline Number of Actions (Output Layers) & 9 \\ \hline Gamma & 0.75 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Training parameters. Figure 10: Network training for both scenarios. (**a**) Cumulative negative reward. (**b**) Average queue size. In contrast, the symmetrical rerouting scenario shows an improvement in reward. By implementing micro-control at each junction, the system dynamically suggests better routes for vehicles, reducing queue sizes and alleviating pressure at critical points. This optimization leads to a higher cumulative reward as congestion is mitigated. In the asymmetrical rerouting scenario, where traffic flow is adjusted to prioritize vehicles moving from west to east, the system adapts by prioritizing phases that facilitate movement in this direction.