# A Study Comparing Waiting Times in Global and Local Queuing Systems with Heterogeneous Workers
## 3 Models and Simulation Setup
### Simulation Setup  
We performed simulation tests using AnyLogic [32] simulation software ([[https://www.anyllogic.com/](https://www.anyllogic.com/)]([https://www.anyllogic.com/](https://www.anyllogic.com/)), accessed on 15 March 2024) for global queue and local queue architectures and two environments: homogenous and heterogeneous. The following scenarios were tested for both architectures and homogenous and heterogenous workers:  
1. A total of 3, 6, 9, and 12 workers with a system load of 0.8;
2. A total of 3, 6, 9, and 12 workers with a system load of 0.93. In a homogeneous environment, all workers have the same mean processing rates. In the heterogeneous environment, the workers were divided into three categories, each with different mean processing rates as follows: Poisson (\(\mu=4\)), Poisson (\(\mu=2\)), and Poisson (\(\mu=1\)) for the fast, medium, and slow categories, respectively. The mean arrival rate for each scenario was set according to the system load, number of workers, and processing rates. To set the arrival rate to the homogenous set, we needed first to find the arrival rate for the heterogenous set. The given parameters are the number of workers, groups, system load, and the mean processing rates for each group for the heterogenous and the homogenous sets. Here, there the formulated configuration for a given system load is given: K--total number of workers and M--number of groups. \(\lambda\)--Poisson distributed arrival rate. In a heterogeneous environment, K workers are divided into M groups, each with g = K/M workers with different processing rates of \(\mu=4\), \(\mu=2\), and \(\mu=1\) in fast, medium, and slow groups, respectively, such as \(\sum_{i}^{M}\mu_{i}=7\). Utilization of the heterogeneous system, \(\rho(ht)\), is calculated in Equation (1). \[\rho(ht)=\frac{\lambda(ht)}{g\times\sum_{i}^{M}\mu_{i}} \tag{1}\]  
where \(\lambda(ht)\) is the arrival rate for the heterogeneous system. Since the parameters \(\rho(ht)\), K, M, \(\mu_{i}\forall i=1,\ 2,\ 3\) are set by us, the mean arrival rate of the heterogeneous system is \(\lambda(ht)=\rho(ht)\times g\times 7\). The mean arrival rate for the homogenous set is the same as the mean arrival rate that was found for the heterogenous set as in Equation (2). \[\lambda(h)=\lambda(ht) \tag{2}\]  
In a homogenous environment, each \(K\) worker has the same processing rate \(\mu(h)\). A homogeneous environment has the same arrival rate as the heterogeneous, which is \(\lambda(h)=\lambda(ht)=\rho(ht)\times g\times 7\). The system load of the homogeneous is calculated by Equation (3). \[\rho(h)=\frac{\lambda(ht)}{K\times\mu(h)} \tag{3}\]  
where K is the number of workers. We wanted to evaluate both architectures under the same load, so \(\rho(h)=\rho(ht)\). Therefore, the processing rate of each worker in the homogeneous setting was calculated by Equation (4) to achieve the same utilization system rate. \[\mu(h)=\frac{g\times 7}{K} \tag{4}\]  
For example, in the case of K = 3 and M = 3, we obtained g = 1 (one worker in each group). For \(\rho=0.8\) in each environment, \(\lambda=0.8\times 0.7\). In a heterogeneous system, the sum of the processing rates was 7; in a homogeneous system, the processing rate of each worker was 7/3 (the sum of processing rates is equal to 7). We performed the simulation using AnyLogic platform version 8.5. Our implementation was based on AnyLogic's Process Modeling library objects, which include queues and service blocks. Within the simulation framework, tasks represented by the simulator'sagent units proceed through a process flowchart consisting of sequences of operational blocks, such as queues, delays, and resource utilization. The input parameters derived from the simulation included the group types, number of workers, load in the homogeneous system (\(\rho\)(h), \(\lambda\)(h), \(\mu\)(h)), load in the heterogenous system (\(\rho\)(ht), \(\lambda\)(ht), \(\mu_{i}\)), queue architecture, dispatching policy, simulation run-time, and the number of replications runs.