## 6 Testing and Measuring Performance: Analysis of PSO, GWO, and Hybrid PSO-GWO Methods
### Grey Wolf Optimization: Testing and Performance Initialization:  
Grey wolf setup: We initialized a set of candidate traffic light schedules (wolves) with random positions (schedules) and velocities (rate of change). Each wolf represented a potential solution to the traffic light scheduling problem. The initialization involved setting the positions of these wolves within predefined bounds, wherein each street is assigned a priority value ranging from 1 to 4. In this application of GWO to traffic signal control, our goal was to optimize the priority given to each street at a four-way intersection. Table 4 shows the limits of the GWO optimization process, and Table 5 shows the parameter set. **Fitness Function:**  
The fitness function evaluates how well a given set of traffic light priorities can optimize the movement of traffic and reduce delays; the goal is to minimize traffic congestion and enhance overall traffic precision. The fitness function considers various performance metrics such as delay, wait time, and throughput. The objective function is expressed in Equation (1). **Evaluation and Update:**  
In the provided GWO code used to optimize traffic light schedules, within the evaluation step, we calculate the effectiveness of each candidate schedule. The traffic simulation function is employed to simulate traffic conditions based on a given set of priorities. Although its current iteration uses a placeholder, it is designed to measure the precision of traffic movement. The fitness score is derived by negating the movement of traffic and aligning with GWO's minimization approach, wherein a lower fitness score indicates better performance. The update step adjusts each wolf's position based on their performance relative to the top-performing wolves (alpha, beta, and delta wolves). The update to be applied is calculated by averaging the positions of these top wolves and incorporating randomness to explore new potential solutions. This iterative process involves recalculating fitness scores and updating each wolf's position and velocity accordingly. If a wolf's new fitness represents an improvement on its personal best, that best is updated; similarly, the global best is \begin{table}
\begin{tabular}{c c} \hline \hline
**GWO Lower/Upper Bound** & **Range** \\ \hline Lower bound (each street needs at least priority 1) & [1, 1, 1, 1] \\ Upper bound (each street can have at most priority 4) & [4, 4, 4, 4] \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Lower and upper bounds of initial GWO parameters. \begin{table}
\begin{tabular}{c c} \hline \hline
**GWO Parameters** & **Parameter** \\ \hline Number of wolves & 30 \\ Max. iterations & 100 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: GWO parameters, including the number of wolves and iteration limits. updated if the current wolf's fitness surpasses the global best. This process continues until convergence or the maximum number of iterations is reached, balancing the exploration of new solutions and the exploitation of existing effective solutions to identify the optimal schedule for this traffic light. The final results, including the best priority settings and corresponding fitness values, are presented herein. Table 6 displays the GWO results, showing the priority given to each street and the corresponding objective performance value, which shows the best traffic flow achieved during the optimization process. Street1 Priority (3.315): Street1 is given a higher priority, which means it receives more green light time compared to some other streets, likely due to a higher traffic flow. Street2 Priority (2.636): Street2 has a moderate priority, reflecting a balanced traffic demand that does not require excessive green light time but still needs some attention. Street3 Priority (4.000): Street3 is assigned the maximum possible priority, indicating it experiences the heaviest traffic and therefore needs the greenest light time to reduce congestion.