## 3 Materials and Methods
### Integrating Machine Learning Model  
In EDs, the dynamic nature of patient influx and medical conditions requires a flexible and responsive scheduling policy. Traditional scheduling policies, while effective under consistent conditions, often struggle to adapt in real time to sudden changes in patient severity and volume. To address these limitations, we integrate ML models that analyze real-time data to select the most effective scheduling strategy dynamically. Figure 3 illustrates the workflow of our ML model, detailing how data flow from collection through to decision-making. * Data generation and collection  
The data are based on the National Emergency Department Information System (NEDIS) Emergency Medical Statistics Yearbook [35]. Data on visit records by hour and patient classification by KTAS are used for tree regions. A total of 9 scenarios are determined, each with different ED entry times, KTAS scores, and compositions of attending and resident physicians. Data are generated when a scenario is entered into ED simulation. Through simulation results, a model is created to provide scheduling strategies tailored to  
Figure 3: Machine Learning Workflow. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**No.** & **Strategy** & **Priority** & **Script** \\ \hline \multirow{2}{*}{1} & FIFO & \multirow{2}{*}{Random} & Any available doctor can be assigned to \\  & (Random) & & incoming patients. \\ \multirow{2}{*}{2} & FIFO & \multirow{2}{*}{Severity-based} & General doctors for less severe, senior doctors for \\  & (Centroid) & & more severe cases. \\ \multirow{2}{*}{3} & SRPT & \multirow{2}{*}{Efficiency} & General doctors handle cases that can be \\  & (General First) & & completed quickly. \\ \multirow{2}{*}{4} & SRPT & \multirow{2}{*}{Efficiency} & Senior doctors handle quickly resolvable, less \\  & (Senior First) & & severe cases. \\ \multirow{2}{*}{5} & CR & \multirow{2}{*}{Criticality} & General physicians are first assigned to the most \\  & (General First) & & severe cases they can manage. \\ \multirow{2}{*}{6} & CR & \multirow{2}{*}{Criticality} & Senior doctors prioritize the most critical patients. \\ \multirow{2}{*}{6} & (Senior First) & & \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Resource Scheduling Policy. the situation. Data generated from ED simulation results are used at three-hour intervals out of 24 h. They utilize the number of patients waiting after triage and the number of attending and resident physicians. Scheduling is applied to data for each scenario, and data with minimal waiting times are utilized. Input data include the total number of patients waiting, the number of queues by severity, and the current availability of interns and attending physicians, while output data represent the respective scheduling strategy. * Feature Engineering and Preprocessing  
We enhance our model's accuracy by developing features that capture the complexities of ED operations, such as peak times, common types of emergencies during specific periods, and average wait times per severity level. These features help the model to predict scheduling needs more precisely. Data include the total number of patients, the number of queues by severity, and the current availability of interns and attending physicians, while output data represent the respective scheduling policy. Only data with low waiting times are used for training. Low waiting times comprise the bottom 25% of data from the quartile. Duplicate data are removed. * Model Selection and Training  
We employ the Backpropagation Algorithm within an Artificial Neural Network due to its efficacy in handling nonlinear data and its ability to learn from complex patterns. This model is trained on historical data from NEDIS, focusing on scenarios that align with current operational challenges. We choose models based on their performance metrics, including accuracy, precision, and recall, ensuring that they meet the high standards required for medical applications.