## 3 Materials and Methods
### Design Simulation Process  
In this study, LoS includes patients admitted after emergency treatment and patients who were not hospitalized. LoS time includes not only the interval from patient arrival at the emergency department (ED) to receiving treatment but also additional time spent post-treatment. This definition allows for an extensive analysis of LoS times across various patient scenarios, facilitating a holistic understanding of resource scheduling and patient experiences in the ED.  
* Patient Flow and Resource Utilization  
The patient flow in the ED, as illustrated in Figure 2, involves a detailed analysis of the utilization of key resources such as nurses, technicians, physicians, beds, ultrasound, X-ray, and treatment rooms. This process is based on general ED processes that have been previously researched and refined rather than being specific to the scheduling for any particular emergency department [24; 31].  
Figure 1: Study design.  
* Simulation Scenario Upon arrival at the hospital, patients are registered. Their arrival methods can vary, including direct walk-ins, ambulance transport, and others. As the initial step, nurses conduct triage based on the severity of the patients' conditions, as referenced in [35]. After classification, patients are divided into three groups according to their severity levels. Those with more severe conditions require longer treatment times and are prioritized accordingly. Patients then wait in the waiting room until they are called. The physicians are categorized into two types: regular and senior, each associated with different treatment times. This classification aids in aligning treatment capabilities with patient needs. The treatment process requires various resources, including medical personnel and equipment within the treatment room. Each resource is designated for specific tasks, reflecting the operational complexities of the ED. This simulation acknowledges the challenge of accurately modeling every aspect of the ED due to the inherent differences between theoretical models and real-world conditions.
* Simulation Modeling We employ both Agent-Based Simulation (ABS) and Discrete Event Simulation (DES) to model the operations of the ED. The detailed components of the processes and agents constituting the simulation are presented in Table 2. DES analyzes the orderly operational flows such as patient arrivals, registration, triage, and treatment from a management perspective, allowing for an efficient layout of ED processes. ABS, on the other hand, captures the behaviors and interactions of individual agents (patients, medical staff) within the system. This dual approach enables us to address the dynamics of ED operations comprehensively.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Type** & **Entity** & **Script** \\ \hline \multirow{6}{*}{Process (Block)} & Arrivals & Patients randomly visit the ED \\  & Registration & Patient registration \\  & Triage & Classification by KTAS level according to patient severity \\  & Wait & Patient waiting after registration. After triage, the patient \\  & Wait & waits before receiving treatment. \\  & Medical test & Medical tests such as X-ray and ultrasound are performed. \\  & Bed & A bed for patients to receive treatment. Time required \\  & Treatment & A doctor provides treatment to a patient. Treatment time \\  & Discharge & varies depending on the doctor’s experience. \\ \hline \hline \end{tabular}
\end{table}
Table 2: Simulation process and agent.  
Figure 2: Patient flow in the ED.