## Queue Time

Read this research article about a cross-docking problem, which proposes a nonstationary queuing model to speed up logistics timeframes. As you read, try to think about your next online order and how your order is fulfilled, packaged, transported, sorted, and delivered. Which part of this process had the longest queue time?

### Simulation

Simulation is a process of analysis and synthesis, useful as a tool to aid decision making in complex productive processes. Therefore, it is understood as simulation of all the process of elaboration of a computational model representative of a real (or hypothetical) system and the conduction of experiments in order to understand the behavior of a system and/or evaluate strategies for its operation.

Simulation is used when it is not possible to experiment with the real system (due, for example, to the time required to perform the experiment, or to the high cost of the experiment, or to the difficulty of physically carrying the experiment). This is also the great advantage of simulation, allowing real studies of systems without modifying them, with speed and low cost when compared to the real physical and organizational changes necessary to study the same alternatives of future scenarios. In this way, changes can be tried and studied in a systematic way without interfering with the real system.

Now by using the simulation it would be viable and practical to check (i) in what level of precision the theoretical model approaches the actual models; (ii) if the issue (i) is not verified, what adjustments are needed to make the theoretical model so that it fits the real problems; (iii) simulation utilizing tools for the problem to be as much detailed as possible, which is not allowed in the theoretical model.

##### 5.1. Modeling and Simulating Model Using ARENA

The package chosen for the simulation process is the modeling process using the Arena Simulator and the model is structured and coded based on the SIMAN simulation language through the selection of modules that contain the characteristics of the processes to be modeled.

When working with simulation, it is initially necessary to define how long the simulation will run (one day, one week, one month, or only a few hours). Normally, this definition is made according to the very nature of the system being modeled.

Finally, another extremely important parameter is how many replications/rounds or samples of the simulation will be made. As in the simulation random variables are provided using probability distributions, running the simulation for just one day does not mean that on that day we will have a "typical" day.

Figure 5 shows a sketch containing the main parts of the simulated model, where- the process of arrival of the trucks in the model starts with the creation of the entity (truck) that arrives at the Distribution Center. In order to simulate the arrivals of the trucks, according to the same criterion used in the theoretical model, a program was developed using the Pascal programming language, where the function that generates the delivery distribution curve of the trucks of Figure 2 was implemented. With each new replication a new distribution curve is simulated for the arrival of the trucks;
- reading
this entry, the truck undergoes a management of the queue; that is,
when arriving at the reception the entity is referred directly to the
attendance at the reception docks. If all the docks are occupied the
entity enters a waiting queue on the patio; as soon as a dock is free
the first waiting truck comes in to be taken care of. It is not in the
interest of this study to find the best unloading dock door for inbound
trucks in order to minimize the distances within the CD for the outgoing
trucks;
- the unloading of the trucks obeys the same distribution of the theoretical model. In the first phase of the simulation, the average service time shown in Table 1 was considered, with discharge times governed by log-normal distribution, with mean 43,8 min and standard deviation = 12,8 min. In fact, the simplified stochastic model described in the previous sections does not allow distinction of vehicle types, and as one wishes to compare the results of the two approaches, an average equivalent type of vehicle is initially allowed;
- after unloading, the truck is routed to the system exit.

**Figure 5** Sketch of the simulated model.

##### 5.2. Simulation Results Analysis Compared to the Theoretical Model

The analysis process of the simulation results performed through the computational model deals with the data that were obtained from the experiments. The main objective is to allow the realization of inferences and predictions about the behavior and performance of the created simulation model. The main reason for a greater attention to the processes of analysis of the results of the simulations is based on the fact that, in general, the models present a stochastic behavior similar to the systems they are imitating.

The verification and validation processes of the model are developed considering the results of the executions carried out in the simulation model. The results of the simulation can be presented in a number of ways. Harrel and Tumay commented that there are several types of simulation reports; among them the author cites analysis of multiple replication reports that provide combined results of several rounds of simulation, making statistical treatments in the results with estimates of errors, within a desired uncertainty range, based on the Output Analyzer.

The analysis of the results also depends on the type of simulation adopted. The simulation can be identified as terminal or nonterminal. The difference between the two lies in the possibility of defining a length for the simulation. If a system has clearly defined a start time and an end time, the system is considered terminal. Otherwise, it is called the nonterminal system. In our case the treated system is terminal. For the terminal simulation it is important to establish how many runs (replications) must take place in order for the statistical results to be consistent.

To be treated it was a terminal system, the chosen form of output analysis was through multiple replications, analyzing the deviations, under an uncertainty rate, with the results being treated through confidence intervals.

As in the theoretical model, the confidence level was assumed to be 95%; that is, . We considered 23 docks for the tests that determine the number of replications. With the aid of the Arena Output Analyzer tool and following the method applied by Freitas and Paulo, a number of 50 replications were obtained (Figure 6), which was adequate to the problem studied, with an overall average waiting time of 0.25, standard deviation of 0.04, and semiconfidence interval of 0.01. According to Freitas and Paulo it is common to find confidence intervals for which the value of is approximately less than or equal to 10% of the sample mean.

**Figure 6** Result of the analysis of the Output Analyzer.

For the analysis of the results obtained with the application of the simulation model, the same variation of the number of doors of the theoretical model was used, from 10 to 29 docks. Table 3 shows the mean of the results obtained with 50 replications.

Table 3 Results of the simulated model application.

Number of positions | Average queue length (vehicles) |
Average waiting time (h) | Average system time (h) | Total average usage time of docks (h) | Average dock occupancy rate (%) |

10 | 37.4 | 3.18 | 3.99 | 15.63 | 85.7 |

11 | 33.6 | 2.65 | 3.41 | 14.47 | 84.1 |

12 | 30.4 | 2.25 | 3.01 | 13.60 | 82.1 |

13 | 26.9 | 1.87 | 2.61 | 12.78 | 80.6 |

14 | 24.1 | 1.59 | 2.32 | 12.17 | 78.7 |

15 | 20.6 | 1.35 | 2.09 | 11.57 | 77.2 |

16 | 18.2 | 1.10 | 1.86 | 11.10 | 75.4 |

17 | 16.0 | 0.93 | 1.63 | 10.63 | 74.1 |

18 | 14.1 | 0.80 | 1.52 | 10.32 | 72.1 |

19 | 11.5 | 0.63 | 1.39 | 10.01 | 70.4 |

20 | 10.2 | 0.55 | 1.25 | 9.68 | 69.2 |

21 | 8.30 | 0.43 | 1.16 | 9.24 | 69.0 |

22 | 6.80 | 0.35 | 1.06 | 9.24 | 65.9 |

23 | 4.90 | 0.25 | 1.00 | 9.10 | 64.0 |

24 | 3.40 | 0.21 | 0.94 | 8.95 | 62.4 |

25 | 2.98 | 0.14 | 0.87 | 8.77 | 61.1 |

26 | 2.23 | 0.11 | 0.83 | 8.77 | 58.7 |

27 | 1.55 | 0.08 | 0.81 | 8.75 | 56.7 |

28 | 0.90 | 0.05 | 0.78 | 8.73 | 54.8 |

29 | 0.30 | 0.03 | 0.76 | 8.73 | 52.9 |

Looking at Figure 7 it is clear that the curves are coincident in almost all points. Two behavioral ranges are observed in the curves, when the variation in waiting time tends to be linear, whereas for the variation is exponential, as in the theoretical model presented. The mean waiting time in the theoretical was 0.23 h, in the simulation it reached 0.24 h, that is, 14.4 minutes. The average queue is 5.4 vehicles in the theoretical model; in the simulated model this number is practically the same as 4.9 vehicles.

**Figure 7** Average waiting time in queue.

Another important factor for analysis of the solution is the average occupation rate of the docks. In Figure 8, the curves of the mean time and total time in the system as a function of the average occupancy rate provide a curve that closely resembles graph 6 of the theoretical model; the curve has an exponential behavior at the beginning tending to linearity as the number of doors increases. It does not make any difference to have more doors to receive loads, because their occupancy rate reaches almost 50% of the total capacity. The total average total time of use of the docks shows that, after the closing of the time window of 8 hours for vehicle reception, the terminal remains in operation for another 1 hour and 6 minutes servicing trucks that still have to be unloaded. Therefore, the previously proposed solution of 23 ports is a possible solution for the case studied.

**Figure 8** Average waiting time and total waiting time.