INTRODUCTION

Queuing theory or waiting lines have become an increasingly common problem in any customer's life, and this is perhaps one of the biggest challenges facing companies. Waiting lines are evident when users or clients arrive at a place requesting a service. A waiting line is formed if the person offering the service is not immediately available and the customer decides to wait ^{1}. Mathematical models have been developed to explain the behavior of waiting for line systems where customers wait to receive service and where these customers are served based on specific selection criteria. In cases where mathematical models cannot be used because the system's characteristics do not allow it, it is decided to use simulation as an appropriate analysis alternative. In all the applications, either with the use of mathematical models or simulation, queuing theory analysis allows finding the efficient operation of service operations, calculating operation characteristics such as the average length of the waiting line, the average value of the waiting time for the system, among others ^{2}.

One of the difficulties in determining the service rate that the system must provide, given the randomness in the arrivals of new clients and that the service time is not fixed in some cases. This information, together with total costs, is useful to determine the appropriate capacity of the system ^{(3, 4)}. In this sense, the analysis of queuing behavior is essential, as it provides both a theoretical basis for the type of service that can be expected from a given resource and how it can be planned.

In the quality of service of waiting lines, there is a crucial aspect related to the total time a client spends in the system. This aspect is a fundamental piece of the first perception that the client receives of the service he will consume. When the client evaluates having spent much time in the system, this will influence the evaluation or total satisfaction of the service ^{5}. This time is dichotomously divided into service time and waiting time in line. In general, shorter service times are preferable, and the negative perception of the waiting period is almost always most significant than the perception of the service time ^{6}.

In some cases, waiting times cause serious problems; for example, patients who are seriously ill in the emergency room may die if the waiting time is extended, the permanent extension of a bank line can cause the withdrawal of funds from a relevant number of customers, the excessive number of ships waiting in ports can cause increased costs due to waiting times, a large number of orders in a restaurant can cause its collapse, causing the customer to leave the establishment or not be happy with the service. To try to correct this problem, some companies have created strategies which are used during the waiting time, for example, the use of televisions with entertainment programs, live music next to the waiting line, or just some creative way to keep the user entertained and calmed during the wait time ^{7}. The point is that this does not solve the problem, it just hides it, and on many occasions, these measures are not enough to make a customer feel satisfied with a service ^{8}^{,}^{9}. The above demonstrates the importance of implementing analytical or simulation models to analyze waiting for lines in environments where excessive waiting times and ignorance of system behavior can cause significant problems.

The present investigation carried out a study of waiting for lines in the process of loading and unloading containers, related to the activities of import and export of goods, in a company in the port of Barranquilla (Colombia). Currently, this company does not have a formal model to analyze its queue system, considering that it mobilized 187,197 containers during the years 2017 and 2018. Of these, 92,450 containers were received in import activities, and 94,747 containers were mobilized in export activities. Furthermore, the company is part of almost 372 companies that provide storage, transportation, loading, and unloading services for containers, and in its current operation, it only controls the times of its processes without analyzing its queue system comprehensively. This operation causes the total costs and the operating characteristics to have not been studied correctly and adequately to improve the processes. For the above, a discrete event simulation model was used in this study, taking as input the random generation of the time between container arrivals and the service time, adjusted to their respective probability distributions. In this sense, the arrivals and exits of containers from the system were simulated as discrete events that allowed analyzing the system's change over time. Likewise, the operating characteristics of the service and the operating costs of the system were calculated and analyzed.

This paper has been structured as follows: Section 2 presents a summary of related works applying waiting line models in real environments. Section 3 presents the main characteristics of the activities in the port of Barranquilla (Colombia). The general principles of queuing theory and the discrete event simulation process applied to queuing theory are introduced in Section 4. Section 5 contains a description of the methodology used in the present investigation. The results and analysis are shown in section 6. Finally, the conclusions of the present investigation are presented in Section 7.

RELATED WORKS

Simulation and waiting line models have been implemented in many fields and contexts. For example, in ^{10}, the application of discrete-event simulation was described for the queuing analysis in a student cafeteria and determining the quantitative requirements for the cafeteria design, considering the randomness of the processes and their interaction. In ^{11}, the queuing theory was applied to the management of organizations to identify a set of performance indicators related to the system's effectiveness, efficiency, and design of the. This research included the proposal of models that link these indicators and their application in production, service, logistics, and health companies. Some authors worked simultaneously using operations research and queuing theory to model waiting line processes in a financial institution ^{12}. The objective was to study the behavior of the queuing systems generated in the services provided by the entity and the analysis of the operating characteristics to study costs. Authors as ^{13} presented a contrast between the queuing theory models and the simulation, where they used mathematical validation models and simulation models to implement it in a service system in a bank. In turn, ^{14}^{)} used queuing theory in the process to obtain ethanol. In this study, an analysis of the different stages of the process was presented and focused mainly on waiting phenomena. In applying of the queuing theory in remote assistance, ^{15} analyzed the efficiency in the provision of remote assistance service for dependent people aged 65 and over. To achieve this, the costs that optimize their operation were estimated according to a model queuing theory. Later, ^{16} explained the advantages of using queuing theory in the poultry sector to promote continuous improvement practices, planning, and communication, helping to reduce the time required in administrative or operational decision-making.

Moreover, ^{17} analyzed the foundations of queuing theory, exposing mathematical models that allow timely decisions to be made optimizing the planning of service and its available resources. The authors applied queuing theory to minimize the system's total costs, showing some models based on probability theory, with great application in multiple real-life situations. Subsequently, ^{18} implemented an automated system managed using queuing theory. This system, applied to the continuous flow of the grain harvest-transport-reception process, ensured the control, reliability, integrity, and availability of the information, and a considerable reduction in the time of information processing. The system provided a set of outputs and graphs that improved the analysis and distribution of information. Later, authors as ^{19} focused on implementing a queuing theory model applied to the "learning behavior of university students." The authors expressed the queue model as a VCHS model (multiple clients, heterogeneous servers) with smart servers. Later, ^{20} carried out a descriptive, longitudinal, experimental, and prospective study in orthopedic consultation in a hospital. The authors determined the patient's satisfaction index and diagnosed the waiting lines (evaluated parameters) through the queuing theory. They used statistical orthopedic techniques using the forecasting method such as regression and non-parametric tests. Recently, ^{(}^{6} modeled the sale of drugs from a pharmacy from the queuing theory approach. The results concluded that the redesign of the service for the current service system, must be assessed and evaluated. Finally, ^{21} studied the cooperative diversity method (CD), which proposes a high-speed data transmission in wireless diversity networks using an efficient queuing system.

As we can see, there are few recent studies focused on solving queuing theory problems in organizations that provide container handling services in the port sector, especially in Colombia. This issue gives greater added value to the present paper and makes it a frame of reference for the study and assessment of port service systems through simulation in container loading and unloading processes. This case study included how to organize, order, and study the input values of the model so that the outputs are suitable for decision making and the system's conclusions (see more details in the METHODOLOGY AND RESULTS in sections). In this way, it serves as a methodological model for the assessing, analyzing, and improving queuing systems in this type of environment. It is also intended to show the correct methodology to address systems in which the behavior of the arrival and service times does not conform to existing analytical models.

CHARACTERISTICS OF THE PORT ACTIVITY IN BARRANQUILLA

Currently, almost everything consumed and used daily by companies worldwide, to be processed or marketed, is related to international trade. In this sense, ports play a fundamental role as connectors for world trade, and their operations are essential for countries' economic and social development . Barranquilla is seen as a sea and river port representing an ideal connection between Colombian producers and the rest of the world, offering competitive advantages to importers and exporters. Thanks to this quality, more than 300 exporting companies in Barranquilla mobilize 59% of what goes through its ports and 1272 industries that import their inputs or raw materials. Cargo handled in the port are, for example, containers, general cargo, bulk cargo, and refrigerated and frozen cargo. In 2018, the port traffic from the different ports of Colombia was 199301737 tons, and of these, the port of Barranquilla mobilized 11057986 tons. Likewise, of these 11057986 tons, 506283 were mobilized in containers in export activities, and 830331 tons were mobilized in containers in import activities ^{22}^{,}^{23}. There are approximately 372 companies in the port of Barranquilla and in the terminals located on the banks of the Magdalena River, dedicated to the activities of storage, transportation, cargo handling, logistics, among others, that generate more than 13,000 direct and indirect jobs ^{22}. In the case of port service systems, it is permanently sought that ships, who transport import or export goods, have a low permanence in the port and thus reduce port costs related to the goods loading or unloading processes and congestion in transit warehouses. These processes show port companies' the importance of analyzing, knowing, and exploring their attention systems where waiting times are generated.

GENERAL PRINCIPLES OF WAITING LINES AND ITS SIMULATION

A summary of the general principles of queuing theory is presented in this section. Formally, a waiting line system is defined as a set of clients, servers, and an order in which clients are served in a birth-death process, where birth is considered to occur when a client enters the facilities of the business to receive the service; while death occurs when the client, once he has been treated, leaves the establishment ^{1}. A visual representation of a waiting line system is shown in Figure 1.

As can be seen, customers who require service are the input source, then they enter the system and join the queue. A queue, a member is selected to receive the service at some point using a rule known as "queue discipline". Once the service is carried out, through a service mechanism, the client leaves the queuing system. Mathematical models have been developed to represent the different waiting for line systems types. These models are made up of formulas and mathematical relationships that can determine the operating characteristics (performance measures) of a waiting line. The formulas of each model depend on the probability distribution that follows the times between the customer arrival and the service times. For more information, see ^{(}^{1}^{-}^{5}. The input parameters for each model are the arrival rate (λ) of units (clients) to the system, the queue discipline, and the service rate (μ) ^{(}^{2}. The arrival rate X represents the average number of arrivals per period. Since arrivals occur randomly and independently of others, we cannot predict when one will occur; however, quantitative analysts have found that the Poisson probability distribution provides a good description of the arrival pattern. This probability distribution is represented in equation 1:

Where, x is the number of arrivals, λ is the average number of arrivals per period and e is a constant (2.71828). Queue discipline is defined as how clients are organized to be served. In general, for most of the waiting lines, units waiting for service are arranged so that the first to arrive is the first to be served. However, there are models for cases where queues are not allowed or models where the queue has limited capacity. For further information, see ^{(1, 2, 5)}. The service rate μ represents the average number of units that can be served per period. In these cases, and due to the service's characteristics, it can be assumed that the service time follows an exponential probability distribution (although not in all cases). In this way, employing the exponential distribution, we can obtain the probability that the service time is less than or equal to a time of duration t, as shown in equation 2:

Where, μ is the average number of clients that can be served per period and e is a constant (2.71828). In this way, these three parameters are essential to predict the behavior of systems that meet the conditions for their application. However, in some cases such as ours, the system conditions and the behavior of the time between arrivals and the service time do not follow a Poisson or Exponential probability distribution (see Results and Analysis section). In these situations, simulation by discrete events is a good alternative to analyze the system, where customers are seen as events that arrive and leave the system at any time, generating the times between customer arrivals and service times randomly. In this sense, the times are used as a simulated clock that determines each client's arrival and service time, allowing the process to be simulated as a dynamic system that evolves over time ^{(2, 5)}. In other words, Discrete-event simulation is the most reasonable option to analyze the queue system behavior when the assumptions required for the distribution of times between arrivals and services cannot be met.

The simulation model implemented in this study takes as probabilistic input the random times between customer arrivals and service times generated from their respective probability distributions via statistical software "Statgraphics Centurion XVIII." A controllable input will be the number of channels or servers in the system (see Figure 2). The outputs will be the system's operating characteristics, such as the average waiting time, the average time in the system, the rate of use of the system, the time that the server is busy, among others.

The simulation starts at time = 0, when the first time is randomly generated between two successive client arrivals, with which the first client arrival time can be calculated. This client will go to the server without waiting in line, so its service start time is the same arrival time. The client receives the service during the service time (time generated randomly according to its probability distribution). Once the process is complete, the client exits the system, calculating the finishing time. The process is repeated for the next clients that come to the system. One consideration is that any client whose arrival time is less than the finish time of the previous client then must wait in line until he can start the service. Figure 3 shows the logical algorithm for this simulation model. This simulation will allow predicting the system's behavior considering the controllable inputs and the randomly generated values of the times, showing how the system should operate to achieve desirable service states. In this way, at the end of the simulation, the following operating characteristics can be calculated: Number of Clients Waiting (NCE), Probability that a client has to wait (PE) = NCE / Total Number of Simulated Clients, Average Wait Time (TEP), Maximum Wait Time (TEM), Average Time in the System (TPSS), Average Service Time (TPS), Total time the server is available (TTD), Probability that the Server is Available (PSD) = TTD / Total Simulation Time, System Use Rate (TUS) = 1- PSD and Total System Cost (CT) = Cw · TPSS + Cs · k; where Cw is the cost of waiting per period for each client, Cs is the cost of service per period of each server and k is the number of servers.

METHODOLOGY

In this research, the target population is represented by all port service companies interested in studying their waiting line system and finding improvements for the highest satisfaction of their clients. The study sample was represented by a company in the sector that offers container loading and unloading services in the port of Barranquilla (Colombia) and which had not previously studied its system through a queuing system. For these activities, 4 workers are necessary to load or unload a container; therefore, a group of 4 workers is seen as a single server in each activity. It began with collecting and reviewing 1458 data related to daily loading and unloading activities, organized from January 1^{st}, 2017, to December 31^{st}, 2018. These data represent 187197 containers mobilized during the 2017-2018 years.

It should be noted highlighted that ships that arrive or leave the port do so randomly at any time of the day, so the company must guarantee operations 24 hours per day. The data was divided into two parts, the first sample with 729 data representing a total of 92450 imported containers that arrived at the port requesting to be unloaded. The second part is a sample of 729 data representing a total of 94747 containers that arrived at the port requesting to be loaded to be exported, with this information, the daily rate of arrivals λ_{E} and the mean time between arrivals 1**/**λ_{E} for loading activities (Exports) were calculated. Likewise, the daily rate of arrivals λ_{
I
} and the mean time between arrivals 1/λ_{
I
} were obtained for unloading activities (Imports). In the unloading containers process, a sample of 90 data was collected to calculate the daily service rate uI and the average service time 1/μI. Likewise, with a sample of 53 data, the daily service rate μ_{E} and the average service time 1/μ_{E} were calculated for loading containers. In total, 1601 data were analyzed. The next step was to determine each process through the goodness-of-fit test proposed by Kolmogorov-Smirnov ^{24}^{-}^{26} (via statistical software "Statgraphics Centurion XVIII"), what type of probability distribution follows the times between container arrivals and service times. This, to know what random values should be generated as input to the simulation model ^{(}^{27}^{-}^{29}. Then, each process (Exports and Imports) was simulated, applying the logical algorithm presented in Figure 3. Finally, the system performance measures were calculated and analyzed according to the results obtained.

RESULTS AND ANALYSIS

The simulation model results applied to the waiting line system in the container loading and unloading company are presented in this section. Containers arriving at the port are served on a first-come, first-served basis, regardless of whether the process is loading or unloading. The goodness-of-fit test results to the times between arrivals and the service times are shown in Tables 1 and Table 2. As we noted, the times between two successive arrivals of containers follow an Exponential probability distribution. However, the service times follow an Inverse Gaussian distribution for the Export process and a Loglogistics distribution for the Import process. The summary of the parameters of each distribution is shown in Table 3. From the parameters in Table 3, it is possible to generate the random values of the times between arrivals or the service times through statistical software. For the analysis and calculation of the system parameters, 30 simulations were performed in each process. A summary of the application of the simulation model is presented in Tables 4 and Table 5. For each case, the arrival of 50000 containers was simulated, randomly generating the times between arrivals and the service times according to their respective probability distributions. The total simulation time is equivalent to approximately one year of operations.

As in the dynamic models, the analysis focuses on the steady-state system's operation; the first 100 simulations have been taken as a starting period. Therefore, these first 100 data have been discarded to analyze of the processes. This discarded data leaves a total of 49,900 simulations available to calculate the system's operating characteristics . Table 6 summarizes the operating characteristics of each process in terms of average value and standard deviation of each parameter for the 30 simulations when there is a single server (current operation).

A monthly salary was taken from each operator of $COP 1200000 to calculate the total cost (TC). 4 operators provide the service simultaneously for loading or unloading the containers; these are taken as a single server. In this sense, the service cost (Cs) per hour will be $ COP 6,666.67 (1200000 · 4 / (24 · 30)). According to the company that provides the service, the waiting cost is $ COP 62.5 per hour per container.

As we can see, for both processes, the average probability that the server is available (PSD) is greater than 75%, and the average probability that a container must wait (PE) is less than 24%.

Likewise, the System Use Rate (TUS) does not exceed 25% in both cases. The above demonstrates the good capacity of the system in the provision of the service. Regarding the average waiting time (TEP), the maximum waiting time (TEM), the average time in the system (TPSS), and the average service time (TPS), we see that these are slightly higher in loading activities. However, these times do not seem to affect the good performance of operations. It is striking that the value of the TEM standard deviation in the Import process is more than double that registered in the Export process, even when its average value is lower. This value reflects the variation generated on the TEM when the different types of probability distributions are combined (Although the other parameters behave similarly, this interaction does not seem to have any influence). In addition, it is observed that the total costs (CT) per hour are very similar in each process, and we note that these costs are mainly influenced by the cost of service (Cs), than by the cost of waiting (Cw). Therefore, an alternative to reduce the TC is to consider reducing, if possible, the number of operators who provide the service. Another alternative would be to automate all loading and unloading operations using technologies that reduce the cost of service.

CONCLUSIONS

The present investigation presented a discrete-event simulation model applied to the analysis of a system of waiting lines in port logistics activable. These activities were classified into two; Export activities related to the loading of containers to ships and Import activities related to the unloading of containers from ships. 1601 data were collected for analysis, and the real probability distributions that follow the times between container arrivals and service times per container were determined. These distributions were simulated randomly as an input to the model. A logical algorithm was implemented during the analysis, and 50000 containers were simulated for each process, equivalent to one year of system operation.

Additionally, the various performance measures and associated costs were calculated. The results show that a container would not have to wait on average more than 0.701 minutes (42.06 s) for the loading and 0.551 minutes (33.06 s) for the unloading. Also, the probability that a container must wait and the system use rate do not exceed 25% in both processes. The total costs, were mainly influenced by the service cost (4 operations provide the service in loading or unloading of containers). Therefore, to try to reduce this total cost, the company could consider reducing the number of operators used in operations or trying to automate its processes with technologies that reduce the cost of service. In conclusion, a simulation model has been implemented as a reliable tool for studying a queuing system in port services, considering a logical algorithm that guarantees the correct analysis of the system performance measures.