## 6 Testing, Analysis, and Results
### Result
#### Average Performance  
Table 2 presents a comprehensive evaluation of various scheduling algorithms, utilizing the metrics previously defined in this study. Taking into account both short and mixed datasets, we first analyze the average performance metrics for each scheduling algorithm. The turnaround time, response time, and throughput are all computed as averages, while [PERSON]'s fairness index is calculated using Equation (8). The migrations field represents the total number of migrations that occurred during the simulation, while scheduled is the total count of context switches. **Turnaround time**: the average turnaround time is notably lower in FCFS and SJF compared with the other scheduling algorithms. This result was anticipated since FCFS and SJF executed each job to completion without any form of context switching. In the box plots depicted in Figures 8 and 9, SJF exhibits significant outliers in turnaround time, attributed to its practice of prioritizing short jobs while delaying the execution of long ones. In contrast, RR, MLFQ, and CFS show a much closer alignment in average turnaround time, as they allocate a time slice to each job for execution. The elevated standard deviation observed for CFS in the box plots can be attributed to the niceness level, which assigns higher priority to specific jobs. On the contrary, except for MLFQ, other scheduling algorithms assign an equal priority to every job. It is worth highlighting that SJF can be proven optimal when all jobs arrive simultaneously [3]. Therefore, SJF serves as a valuable benchmark when comparing other scheduling algorithms in terms of turnaround time. **Response time**: the average response time for MLFQ and CFS surpasses that of the other scheduling algorithms, particularly FCFS and SJF. While one might anticipate RR to exhibit a better response time due to its consistent context switching at a given time quantum, the queuing mechanism, and prioritizing jobs in a first-in-first-out order, which results in later arrivals being placed at the back of the queue and experiencing delays. MLFQ and CFS, employing a form of priority, often allow newly arrived jobs to run at an earlier stage, contributing to an overall improvement in the system's response time. Both SJF and CFS exhibit more outliers in their response times, as evident in the box plots of Figures 8 and 9. **Throughput**: since throughput is calculated as the turnaround divided by the total time for a given job, schedulers with high throughput are desirable. However, it is crucial to note that the throughput, especially for SJF, can be somewhat skewed due to certain jobs experiencing prolonged periods of starvation. The box plots provide a useful indication of how various scheduling algorithms perform concerning throughput. Moreover, it is worth acknowledging that values close to 1 may indicate the first arrived job in the local queue, especially for FCFS, SJF, and CFS. **[PERSON]'s fairness index**: with the exception of SJF and RR with mixed jobs, the fairness values for most scheduling algorithms are closely aligned. This suggests a relatively even distribution of CPUs. What was somewhat unexpected, however, was that CFS had the lowest fairness value. In hindsight, this observation aligns with expectations, given that the niceness level significantly influences the standard deviation of the turnaround, as previously discussed. Consequently, this impact extends to the throughput, a factor that [PERSON]'s fairness index considers. **Migrations and scheduled**: in the case of FCFS and SJF, there are zero recorded migrations, even though jobs might have transitioned from one CPU to another. The calculation of migrations is based on job execution on a CPU; if a job does not execute on two different CPUs, it is not considered as migrated. While fewer migrations are generally preferable, schedulers allocating time slices to jobs, such as RR, MLFQ, and CFS, are expected to encounter migrations.