Determining the Minimum Waiting Times in a Hybrid Flow Shop Using Simulation-Optimization Approach

Planning the order and size of batches is an extremely complex task especially if these tasks are related to production companies in a real environment. This research deals with the problem of determining the entry order and size of product batches in order to optimize inter-operational waits, in the form of waiting in queues for processing and waiting due to the setting-up of the workplace. In real environment, these waits represent a large share of the time spent in the production of a unit of product in a hybrid flow shop. This problem is almost impossible to be solved with analytical models because they may require many simplifying assumptions. Therefore, a simulationoptimization approach is used to solve this problem. Discrete event simulation allows greater flexibility in the representation of the real production system, while the integrated optimization tool, a genetic algorithm, serves to find the optimal solution relatively quickly. To ensure simpler production management, batch size is defined as a fixed value with the exception of a different first or last batch which represents the difference to the required production volume. Therefore, two optimization cases are presented in the paper. Although both cases show improvements, the case when a different batch is the first batch shows better results. In that case, the share of setup time in the total production time of the product unit was reduced from 4% to 3%, and the share of waiting time in the queue for processing was reduced from 76% to 32%.


INTRODUCTION
The increasing market requirements arising from the increasing complexity of products and increasing different product variants with changeable production volumes cause industrial production systems to become more complex, looking from technological point of view and from the standpoint of production management. The key to success in staying competitive in today's volatile market environment lies in production planning. Production planning has a very important impact on the efficiency of a production company. The basic task of production planning is to ensure the required product quality, with the lowest possible production costs and on-time delivery. An important role in this realization is played by operational preparation activities, which include planning production operations, launching and monitoring of production, transportation, provision of tools and raw materials, i.e., activities that define the production schedule and provide all necessary resources.
In operational production planning, among the most difficult tasks are decisions related to planning the size of batches and planning the order of batches for a particular product and / or group of products. Determining the order and size of a unit batch is a form of decision making that plays a crucial role in the manufacturing and service industries. Manufacturing companies must deliver goods or services on time to avoid losses and ensure competitiveness [1]. In general, scheduling problem can be summarized through two questions, and these are:  What activities must be performed to meet the given requirement (division of production quantities into batches)?  In what order to use the given production resources (allocation of batches to production resources over a period of time)?
On the one hand, planning the batch size ensures the division of the total production quantities of a product into smaller groups, i.e., into batches of that product. In other words, one work order is divided into several work tasks depending on the quantity of batches. On the other hand, batch sequencing involves the allocation of available production resources to particular batches over a period of time. In todays environment, order planning and batch sizing is an extremely challenging and difficult task. Especially when it comes to hybrid flow shops which are typical for manufacturing companies for production to order and mass customization [2]. This paper consists of seven sections. The first section presents the starting point of problem in this paper. This is followed by theoretical background and literature review of the research findings of scheduling problem in hybrid flow shop. The third section presents problem definition. Methodology and general assumptions are presented in the fourth section. The fifth chapter describes the application on example from the real environment, and the next chapter presents the results of this research. The paper concludes with a presentation of key findings.

BACKGROUND AND LITERATURE REVIEW
In the last few years, a large number of researches that have dealt with this problem can be found. A review of scientific research related to the problem of planning production operations and planning the order of production was given by Negahban and Smith [3]. Mendez et al. [4] in their paper describe the influence of system layout on the complexity of problems in production systems with batch production type, depending on whether the system consists of only one stage or several stages, as well as the number of parallel machines within a particular stage. If the products move through the system unidirectionally then we are talking about flow shops. Hybrid flow shops (HFS) are characteristic for the production of medium and large quantities of a larger range of technologically similar products. The characteristics of HFS are as follows:  there is more than one stage in the production process,  there is one or more production capacities in each of the stages,  all work tasks are subject to priorities that limit them to the same order of production at all stages of production,  each production capacity can perform a maximum of one production operation of any work task at a time,  a production operation of a particular work tasks cannot be performed until the previous production operations of that work task have been completed,  once the production operation at the production capacity has started, it must not be interrupted,  there are no alternative orientations, i.e., the operation of a work task can be performed by only one type of production capacity,  after the completion of production operation at one production capacity, the work task joins the queue at the next production capacity,  there is no limit to the length of waiting at any production capacity.
One of the main features of hybrid flow shops in a real environment is their high productivity and low flexibility. This means an extremely little space for manipulation with the production time to take place in order to avoid delivery delays. Therefore, it is worth paying great attention to the waiting times (setting-up the workplace, transport, control, waiting in queue for production, etc.) that occur during this type of production.
Naderi et al., stated that in many real-world situations, such as automotive or chemical production, setup activities, such as cleaning the workplace or replacing tools, are not only necessary between work tasks but also depend on the immediately preceding work task at the same production capacity [5]. A review article related to the scheduling problem where the setup time depends on the product sequence was given by Allahverdi [6]. He also introduced a very significant classification and notation of scheduling problems, based on the production environment, process characteristics, process setting conditions, and performance measures. Yang et al. [7] are one of the authors who dealt with the problem of transport equipment availability. Perinić et al. [8] in their work include the availability of transport equipment with the aim of optimizing the flow time.
In addition to the problem of order determination, a number of papers related to the batch planning problem can be found in the literature [9][10][11]. Batch planning primarily refers to determining the size of a batch. It can be defined as a fixed or variable value. The range of batch sizes can vary drastically; therefore it can be a big problem in production management and control. Bearing in mind the complexity and dimensions of the product, large differences in the size of batches may require different types of transport equipment, increase buffer spaces and so on. Ultimately, for these reasons, the variable size of batches can very easily be unfavourable for application in production in a real environment. On the other hand, the fixed size of a batch represents a constant number of product units that make up each batch. This ensures simpler production planning and management, which is often correlated with reduced production costs. The fixed size of a batch can also minimize the flow time of product [12], but it stipulates that the total quantity of products must be a multiple of the value of the fixed batch size. It can be concluded that for production in the real environment it is desirable that the batch size can be a combination of fixed and variable value.
Currently, production companies use a variety of planning methods, modules, and techniques based on deterministic algorithms, while evaluating different performance measures [13][14][15]: completion of production, flow time, delivery times, etc. As deterministic algorithms do not include numerous uncertainties from the real environment, such as machine failure, occurrence of scrap and so on, it is necessary to provide a certain type of support that will enable better and, above all, simpler production planning and management. It should be borne in mind that when developing a model for determining the schedule of activities, it is important to take into account all the characteristics of production to ensure the feasibility of the proposed schedules. However, production should be presented abstractly in order to reduce the computational complexity of the problem. This is even more important when it comes to real production companies, which are usually characterized by complex structures, a growing range of products and a huge number of constraints that must be taken into account.
Accordingly, the authors use discrete event simulation (DES) to describe production systems from a real environment [16]. For example, Rupnik et al. [17] in their paper present a DES approach for simulation of distributed energy resources. The main advantage of DES is the ability to create a digital model of the real production system in a relatively simple way, without interfering with the operation of the real system [18]. The digital model created in this way can be reproduced an unlimited number of times. However, the main disadvantage of DES lies in the fact that it does not find an optimal solution [19].
Linking DES with some optimization tool has proven to be a very good solution. This is evidenced by the growing number of papers that use this approach to solve scheduling problems. The simulation-optimization approach evaluated various performance measures. Authors Dong and Medeiros [20] in their work minimize the total cost of production in a single-stage production system. Ištoković et al. [21] present a simulationoptimization approach to optimize total production cost in HFS. Pekarcikova et al. [22] in their paper proposed the introduction of Kanban logic in material flow control to improve machine productivity, machine efficiency and processing time.
However, so far it has not been found that the authors used a simulation-optimization approach to solve the problem of optimizing inter-operational waits, in the form of waiting in queues for processing and setup times, which in practice proved to be the largest time spent in product unit manufacturing in some HFS.

PROBLEM DEFINITION
This section describes the problem of this study. Influential factors are defined in the form of different times that affect the course of production in HFS. Special attention is paid to the inter-operational waits in the form of waiting in queues for processing and waiting for settingup the workplace. The parameters are given as follows: waits for all product units to be processed, is probability of entering product j into production process. In batch production in the HFS model, the products are moving in batches through the system. The time spent by a certain batch of products in the production process, from the moment of its entry into the system from the warehouse of raw materials until the exit from the system to the warehouse of finished goods, is called the flow time. If it is desired to observe a particular unit of product from a certain batch, separately, then the flow time of any product unit is equal to the flow time of that batch. In the literature, the flow time is one of the most commonly optimized performance measures [23]. The flow time can be defined as the total duration of all operations as well as technically and organizationally conditioned interruptions in the form of control, transport and inter-operational storages, during the production of a unit of product or for a certain quantity with which production enters at once. Technically and organizationally conditioned interruptions are often referred to as inter-operational waits or delays.
Processing time is the time in which a certain unit of product is processed at a certain production capacity at a certain stage of production. The total time of all operations for processing one unit of product is given by Eq. (1), as the sum of all processing times.
Inter-operational waiting time is the time in which qualitative changes in the product are not contributed, i.e., in that time the engaged resources do not give any production results. The duration of inter-operational waits can vary from a few minutes to a few days (depending on what kind of wait it is), but they can be determined. Interoperational waits can be divided into three basic groups: control time, transport time and inter-operational storage time. Product control is important because it ensures necessary quality for the delivered products. Product units can be inspected as part of the operation and/or after completion of all operations. If a unit of product is controlled as part of an operation then the control time is contained within the processing time. Otherwise, it is calculated according to Eq. (2). In order to ensure the transfer of product batches from one workplace to another workplace, transport must be provided. Transport time means the time spent by a certain batch of products moving from one workplace to another, including transfer from the raw material storage to the workplace and transfer from the workplace to the finished products storage, Eq. (3). Interoperational storage time includes all those waits that a unit of product spends waiting in queue for processing (in front of the workplace) due to occupancy (unavailability) of production capacity, waiting for setting-up the workplace (depending on different batches of products), waiting for processing (particular workplaces participate in the realization of several parallel processes) and waiting in queue for transport (behind the workplace) due to occupancy (unavailability) of the transport equipment.
A waiting in queue for processing is considered to be all those times at the input buffer of a certain production phase where a unit batch of products is waiting in queue for its processing at a certain production capacity or workplace, Eq. (4). When production capacity is released, the first batch in the queue comes to processing. If the batch is different from the previous batch, it is necessary to carry out activities of setting-up the workplace, Eq. (5) and Eq. (6). Setting-up the workplace is an activity that is unavoidable in the function of performing the production task, but blocks the workplace for a certain period of time, which means a loss of part of the production capacity. This loss is extremely sensitive in work tasks with frequent changes of operations and this is especially pronounced in the production of a larger range of products. With the completed setup, the product units are processed at the available number of production capacities. The time a product unit spends waiting for all product units of the same batch to finish processing, is called waiting time for processing, Eq. (7). Each product unit waits for processing, and after processing, it waits for the remaining product units to finish processing at that workplace. After all product units have been processed, a batch waits for a transport equipment to move it to the next stage, Eq. (8). This time depends on the availability of the transport equipment.
However, production in a real environment is characterized by certain uncertainties such as failure at production capacity or uneven setup times. Each production capacity at some point does not work due to a failure. Depending on the level of reliability of the production capacity, the rate of failure also depends. The time that the production capacity does not work directly affects the waiting time of the remaining product units to be processed. With this knowledge, the waiting time for processing can be represented as the sum of the time required to process all product units of a batch and the failure time while that batch was processed, Eq. (9). The failure time can be zero, i.e., failure did not occur. On the other hand, the time when the production process is not running indirectly affects other batches where it increases the waiting time in queues for processing. Likewise, the time that work staff setting-up the workplace is not uniform. The reason is the different work staffs that perform this activity (work in multiple shifts), motivation and fatigue. Therefore, if there are several identical production capacities within a stage, it is certain that the production capacity will start processing a certain batch at different times.
Such forms of uncertainty appear randomly and do not affect equally each batch. Therefore, the occurrence of uncertainty increases the waiting time of a unit of product of a certain batch, and thus increases the flow time. For this reason, the flow time will be calculated as the time that each batch spends in the process, i.e., the difference between the time when a batch exits from the production system and the time when a batch enters into the production system, Eq. (10). Since the values of the flow time are certainly unequal due to simpler further optimization, the average value of the flow time is calculated, Eq. (11). The same rule applies to all inter-operational waiting times.
From all the above, it can be noticed that the inclusion of uncertainty can have a significant impact on the timing of the production process, and especially on interoperational waits in the form of waiting in queues for processing and waiting due to setting-up the workplace, Eq. (12). When the influence of the size and entry order of a batch of a larger range of products is added to this, finding the optimal solution is an extremely difficult task.

METHODOLOGY AND PROBLEM ASSUMPTIONS
As mentioned earlier, for production in a real environment, it is desirable that the batch size can be a combination of fixed and variable value. The amount of product that needs to be produced can be any number, and this often means that the batch size will not be fixed, and thus can lead to difficult production planning and management. The solution to the problem of how to ensure the production of a sufficient quantity of products while ensuring simpler production management can be shown by Eq. (13) and Eq. (14). All batch sizes of a particular product will be equal except one, which will amount to as much as the difference to the defined total quantity of products [24]. This single batch can be produced as a residue in the form of the last batch BS j,last , or in the form of the first batch BS j,first , which leads to two optimization cases.
The order of activities in HFS will be determined using the probability of entering a batch of products. However, unlike the author [24], the probability of entering a particular batch is determined as a direct value in the form of a percentage, Eq. (15) and Eq. (16). This allows a faster search for a solution due to the reduced number of possible input variants. In other words, the possibility of duplicating the same input variants has been ruled out. The value of the probability of entry is defined to three decimal places, e.g., PoE = 0.147 or 14.7%  (16) This problem is almost impossible to solve using mathematical methods. In general, production in a real environment is extremely difficult to describe in this way. For this reason, DES is increasingly used, which makes it easier to describe such systems. It should be borne in mind here that real production systems are complex and when creating a simulation model, the system needs to be simplified or only one part of it needs to be observed, provided that the results are still realistic. However, DES in itself does not ensure that an optimal solution is found.
Therefore, finding the optimal solution is ensured by using a simulation-optimization approach, according to Ištoković et al. [21]. This approach combines DES and a GA optimization tool. DES allows the creation of a computer model of the actual production system and the inclusion of characteristic uncertainties, while the GA allows relatively fast finding of the optimal (or almost optimal) solution.

APPLICATION ON CONCRETE EXAMPLE
The observed case was applied to a concrete example of a production system from a real environment that deals with the production of technologically similar products. It was necessary to make the current production simpler and more efficient by grouping three technologically similar products into one production process with the basic goal of delivery on time the contracted quantities of product D, product E and product F. After processing, the products are packaged and delivered to the customer. Delivery of contracted product quantities is scheduled every two weeks. The contracted quantities of the listed products as well as the recommended batch sizes are shown in Tab. 1. Production takes place during five working days a week (Monday to Friday) in two working shifts, and each working shift lasts eight hours, i.e., the maximum available time for processing the stated quantities of products D, E and F is 80 hours. First of all, a simulation model was developed within the Tecnomatix Plant Simulation software package. The developed model consists of a total of 11 machines arranged within 5 stages, in order: 2, 3, 3, 1 and 2 machines. The observed production system is a hybrid flow shop. Therefore, batches of products move unidirectionally through the production system. They are processed within all stages. Tab. 2 gives data on the order and processing time in a particular stage. Times are expressed in the format minutes: seconds (min:sec). At the entrance to the production system, in raw material storage, batches of products are created. It is determined which batch enters at what time and what the batch size is. There is a restriction that the last (in the second case the first) batch of each type of product assumes the value of the remaining difference, up to the required total production quantity. With the arrival of a batch in one of the stages, the batches are waiting their turn for processing at the input buffer. Using FCFS logic, batches are directed on processing, in such a way that product units are assigned to available machines (depending on the number of machines in the particular stage). If the type of product that currently needs to be processed is different from the previous type of product, then it is necessary to set-up the workplace. After the last product unit from a certain batch is processed, then that batch is directed to the output buffer, i.e., it is transferred by transport equipment to the next stage or to the finished products storage. A conveyor is set for the transport equipment, which is always available. Therefore, there is no waiting in queue for transportation. Input data of the setup times and the failure rate at the machines as well as the required mean time to repair (MTTR) are given in Tab. 3.

RESULTS
After the simulation model is made, its validity is checked in the form of verification and validation. In other words, it is checked whether the elements within the model as well as the whole model behave as intended, i.e., whether the simulation model gives correct results for known input values. The simulation experiment for the proposed input data, Fig. 1, showed that completion time of production is approximately 79 hours and 49 minutes, or 11 minutes or 0.23% shorter end time of production than the proposed time, which is a slight difference caused by various uncertainties and variation of defined input parameters, such as setup time or machine failure. Accordingly, based on the results of these two checks, it can be argued that the developed simulation model of the observed HFS was correctly set up.
From the obtained results it can be seen that the assumption of this work has been confirmed, which is that during production of a unit of product most of time is spent waiting in queues for processing and waiting for setting-up the workplace. Although a relatively large portion of time is spent for setting-up the workplace, the largest portion of time of a product unit is spent waiting in queues for processing, which makes up about 76% of time spent in the production process.
After confirming the validity of the proposed simulation model, optimization can be approached. For this production process, it is necessary to determine the entry order of batches into the system and the batch size of products D, E and F in order to optimize the interoperational waiting times. To be more precise, waiting times in queue for processing and setup times. Optimization was performed using an optimization tool, a GA that was implemented within the developed simulation model. The results for each case were obtained by testing different values of the parameters of the GA by performing a large number of experiments. The experience gained in this way has shown the superiority of some, and only the best results are shown.

Case 1 -Different Last Batch
In the first case of optimization, it is set that the last batch of a particular product is different from other (fixed) batches. The GA parameters are set as follows: the number of populations is 30, the number of generations is 200, the number of observations is 5, the probability of crossover is 0.8, and the probability of mutations is 0.12.
The optimization results show that the on-time delivery condition is met and that the values of the average waiting time in queue for processing and the average setup time are reduced, see in Tab. 4 (given format is days:hours:minutes:seconds).

Case 2 -Different First Batch
In the second case of optimization, it is set that the first batch of a particular product is different from the other (fixed) batches. The GA parameters are set the same as in the first case.
The optimization results show that the on-time delivery condition is also met (see in Tab. 4) and that the values of the average waiting time in queue for processing and the average setup time are an additional reduction compared to case 1 when the last batch is different from the other batches of the same product. While the setup time was slightly reduced, the obtained results showed a significant reduction in waiting time in queues for processing, Fig. 2. Especially for case 2, where the portion of time spent in queues for processing is reduced to 32%, which represents a big improvement. It can be concluded that from the point of view of simpler production planning and management it is better when all batches of products are fixed except the first one which is equal to the difference to the required total quantity of a particular product.

CONCLUDING REMARKS
The conducted scientific research is based on the findings published in the scientific and professional literature in the field of operational production planning, based on the problems of determining the batch size and determining the entry order of batches of products into the production system. The knowledge and experience of relevant theorists and practitioners in the above fields were used.
Production in a real environment is characterized by a large number of different parameters that determine the order of activities in the production process. Therefore, such problems are almost impossible to solve by mathematical methods without the introduction of large simplifications. Consequently, a DES was used which allows, in a relatively simple way, a more realistic representation of production in a real environment. This research deals with the problem of optimizing interoperational waits, in the form of reducing the waiting time in the queue for processing and setup time. The stated waiting times represent the largest time consumption in the production of a particular unit of product, which is confirmed by the output results of the developed simulation model.
In order to find the optimal solution to this problem, a simulation-optimization approach based on the DES with an integrated optimization tool GA, was applied. The GA makes it possible to find the optimal solution for the optimal values of batch size and probability of batch entry into the system. In doing so, to ensure simpler production planning and management, batch size was defined as a fixed value with the exception of a different first or last unit batch which represent the difference to the required total production volume. The above led to two optimization cases. In the case where a different unit batch represents the first unit batch, then the optimization showed better results.
The obtained results indicate the possibility of a significant reduction of the waiting time in the queues for processing. That reduction reduces the time for the production of the agreed product volumes, but also the possibility of accumulating a large number of batches on the input buffers. Consequently, the results of the research are applicable in various production environments, especially those engaged in the production of a wide range of technologically similar products. Also, the results of the research can find their application in further research and development of operational production planning.
Future research should focus on the introduction of working staff into the system, i.e., what is the impact of the introduction of working staff on the results obtained and how many working staff are needed for production to work smoothly.