## 5 Experimental Results  
### Comparison between Simulated Annealing and the Genetic Algorithm  
After calibration, the parameters of SA and GA should have the values exhibited in Table 7.  
Figure 8: Analyzing average waiting time relative to number of repetitions in GA.  
Figure 7: Analyzing variations in average waiting time relative to population size in GA. The SA and GA algorithms tested above attempt to minimize fitness. The SA has a great deal of variation, and a good solution is found after that. The GA converges more rapidly and steadily to a solution. The GA presents a small improvement (if not) to modify the solution. As depicted in Figure 10, the GA achieves a better fitness value than SA for most of the tested cases. The GA proves more successful in accomplishing this task. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Simulated Annealing** & \multicolumn{2}{c}{**Genetic Algorithm**} \\ \hline
**Parameter** & **Value** & **Parameter** & **Value** \\ \hline Initial temperature & 100 & Population size & 160 \\ Cooling rate & 0.9 & Crossover rate & 0.8 \\ Number of iterations before & 10 & Mutation rate & 0.2 \\ a temperature change & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Parameters used for SA and GA algorithms. Figure 9: Comparison between genetic algorithm and simulated annealing method. Comparing the performance of the genetic algorithm (GA) and simulated annealing (SA) based on Figure 10 reveals interesting trends in solution variations across iterations. SA exhibits a higher average waiting time than GA in the initial phases (N = 1 to N = 5) to explore better solutions at the outset. As the iterations progress, GA consistently generates solutions that match or excel those of SA. Moreover, GA shows a more consistent and progressively improving trend in solutions than SA, which demonstrates larger fluctuations in its performance throughout the iterations. This analysis suggests that GA exhibits better convergence and more consistent improvement, ultimately outperforming SA's solutions consistently as the iterations proceed. Based on Figure 10, we can compare GA and SA over several metrics: average waiting time, best solution, worst solution, number of function evaluations, and CPU time in seconds (Table 8). GA has a lower average waiting time performance of 35.2 and has smaller variability in results to ensure reliability throughout the cycle. Furthermore, GA achieves an excellent solution of 17 (the best solution). On the other hand, SA shows a slightly higher average performance (39.65) and shows greater variability in results. The best and worst solution for SA of is less favorable than the best and worst solution for GA. Importantly, SA operates more efficiently, requiring significantly fewer function evaluations (58,348) and less CPU time (6.50 s) than GA's 100,000 evaluations and 11.30 s, respectively. In the end, the choice between GA and SA depends on priorities--whether the preferred emphasis is on a lower average waiting time performance with consistency (GA) or slightly higher variability with improved computational efficiency (SA). Regarding average waiting times (Table 9), genetic algorithms (GAs) tend to result in greater computational time than simulated annealing (SA) in most scenarios. The average waiting time for GA is 37.42 s, whereas for SA, it is significantly shorter, at 29.17 s. Consequently, based on these results, it seems that, in this problem domain, simulated annealing (SA) outperforms the genetic algorithm (GA) by reducing computational time for the given scenario. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Algorithm** & **GA** & **SA** \\ \hline Average waiting time & 35.2 & 39.65 \\ Best solution & 17 & 20 \\ Worst solution & 70 & 80 \\ Number of function evaluations & 100,000 & 58,348 \\ CPU time in seconds & 11.30 & 6.50 \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Comparison of GA and SA for the optimization of waiting time to optimize elevator-car dispatching.