Keywords

1 Introduction

In the current highly competitive environment the strategy of the production is changing from mass production for the production in smaller lot sizes in order to include rapid changes in customer preferences and the demand [1, 2]. Customers do not want to receive large batches at once, since they want to minimize the frozen capital into the equipment and inventories. On the other hand, manufacturers also want to reduce their inventories including the WIP (work in progress), as well as the total cost of production and the production cycle. Due to the large variety of products and fluctuating demand production planning and scheduling problems for small batch sizes is very complex. It is very difficult to control costs and meet deadlines.

There is many specific definitions and concepts in the area of production planning and management [3]. The majority refers both to the strategic, as well as operating horizon and is finding application with reference to the production planning and the production structures design and the operational production management.

Since the mid-1950s production planning optimization problems have been the subject of an active research area. Johnson [4] is often regarded as the precursor in this field with his attempts of optimal two and three-stage production schedules. At that time two mainstreams research could be distinguished. The first one was an attempt to develop a method for finding optimal solutions. Test problems were generated randomly or practical oversimplified problems reduced in sizes were the focus of attention. The optimization methods applied were mainly complete search, integer programming, branch and bound method, and dynamic programming. The second mainstream of scientific research was a great variety of methods that explore the search space in order to find near–optimal solutions for problems of size and complexity found in real enterprises. The methods used in this area include heuristic methods, as well as expert systems [5]. One of the major problems emerging in the area of operational planning and scheduling is the problem of determining the lot size (lot sizing and scheduling problems). Determining the lot size is a part of the medium-term operational production planning. If the lot sizes are appropriately defined and arranged in the time, a production process should be profitable and run smoothly [6].

The paper presents the opportunity of using a computer simulation based on genetic algorithm to optimize the production schedule for many simple products with limitations in a finite planning horizon for dynamic demand. Algorithm and model assumptions will be discussed later in hereby work.

2 Application of Genetic Algorithms (GA) in the Area of Lot Sizing and Scheduling

2.1 Trends in the Models for Determining the Lot Size and Scheduling

There are many different procedures which have been developed for determining the lot size and the temporary deployment of supplies for the manufactured components in production planning systems. Although the number of developed procedures include methods applying simple decision rules to the extensive optimization procedures involving intelligent techniques, there is surprisingly small help for managers choosing procedure for the lot sizing under the specific production and organizational conditions.

Traditional methods do not consider the uncertainty of demand and refer to future demand as stable and constant leading to the situation that the precise and complex calculations become worthless at the time of any fluctuation in demand. Currently used traditional methods also have another weakness, which significantly limits their practical applications. Seeking optimum considering all possible cases, therefore when planning horizon increases the amount of optional schedules dramatically increases [7, 8].

2.2 The Review of Selected Methods Applying GA in Lot Sizing and Scheduling Problems

One of the first authors, who suggested the use of genetic algorithms in the field of scheduling and lot sizing was Davis [9]. He drew attention to the possibility of using probabilistic methods of local search in environments with large search areas and developed representation in which genetic algorithm operates on the list, which continues to be decoded to generate the schedule.

Khouja [10] introduced a genetic algorithm for the problem of scheduling and determining the economic lot size that provided the average results 3–11% from the theoretical lower limit. The lot sizing problem in MRP systems using genetic algorithms was discussed by Stockton and Quinn [11]. They used a genetic algorithm to develop a multi-level technique for lot sizing.

Apart from the determination of an optimal delivery the essential part of production planning and control in a manufacturing company is to generate a production schedule. The production lines are now being used for the preparation of a variety of products forming a product family. The manufacturer depends on efficient production minimizes the total cost, total production cycle and production line setup changes. The problem is finding the proper sequence of produced models needed to meet market demands. In the case of assembly lines working under some tact time cycle, the time required to perform suitable work at each station is limited to a certain maximum value. Scheduling and determining the size of the lot was discussed by many researchers [12,13,14,15,16,17,18,19,20].

Optimality criteria of production scheduling problems for measuring performance can be classified into four basic families [21,22,23,24]: (1) first family minimizes the biggest value of a given function of the completion times for the whole set of jobs, (2) second family minimizes the average value of a given function of the completion times for the whole set of jobs, (3) third family minimizes the weighted sum of given function of the completion times for the whole set of jobs, (4) miscellaneous family. Sequencing, timing, routing, forecasting, labeling, grouping, aggregation, and disaggregation are the main issues of scheduling function [25].

Most of researchers consider objective functions that refers to costs (holding cost, setup cost) [26,27,28]. Models very often refers to economic lot sizes environments assuming that demand is stable and constant. On the basis of available articles it can be stated that the use of genetic algorithms within the issues of determining lot size and scheduling is quite common. In manufacturing companies it is often based on their own experience, practice, as they are not trusting complex mathematical models.

Much more frequently developed models refer only to the aspect of lot size. Only since 2007 has there been an increase in interest in the integrated area of batch determination and production scheduling. Most methods are constrained models assuming finite planning horizons and refer to single-level products. About half of the models assume static deterministic demand and the other half is dynamic demand. Approximately 50% of the selected models take into account the time of rearms as one of the constraints when creating a genetic algorithm. The authors considered that the little attention of researchers was devoted to scheduling production while simultaneously determining the size of batches for single-level items, with constraints - setup times where planning horizon can be fixed and dynamic as well, and demand: dynamic or probabilistic dependent on the model source of input data. Therefore they developed such model.

Due to the volume limitation of the article, other models and work in this area are not discussed here. The authors have compared metaheuristics in the discussed problem area in the article [29].

3 Characteristics of Problem Area

The goal of the research is to develop a production schedule for couplings based on customer orders indicating the order of production of couplings and the batch size to allow for shortening total production cycles. In the first stage of the simulation main focus is to create the best available production schedule based on standards of lot size and orders deadlines predefined by the customers.

The company manufactures production parts whose manufacturing process is based mainly on mechanical processing combined with both chemical and thermal treatment. There are also many special processes: soldering, surface sanding, smoothing. Unfortunately, none of the production lines is autonomous, which means that there is a need for co-operation in the production process, both internal and external.

Range of goods of manufacturing couplings on the line comprises about 70 pieces and 60 couplings is in fact active (they are really produced). Because of the specifics of the problem, i.e. the number of independent variables, the problem is solved using a genetic algorithm, which effectively searches the huge solution space of the problem.

The analyzed production line consists of 19 processing stations. Basically, based on the reports in the SAP system, the customer’s demand forecasts can be seen and consequently how the order is made each month. The line is not adapted to lean production and there is no way of introducing a one piece flow, hence the size of the series is adjusted. The sales forecasts for the couplings are currently 20 months ahead, with a probability of around 80% based on past experience. Demand is changeable and unstable. The model refers to individual products (clutches) without penetrating into their structure the complexity of the BOM. Considered planning horizon is variable but no more than 130 days. Machines will have fixed production capacity and the production line runs 16 h a day.

4 Description of the Algorithm

At the beginning it is useful to define the basic concepts of the simulation scheme. The environment is a set of possible “orders” to carry out production of couplings (up to 16 different types were accepted), and the order for the same coupling may repeat any number of times, but to e.g. different deadlines. The individual of environment is the sample of realization of the contract with specific “genotype” determined in chromosome- unique sequence of production of couplings and each data is necessary for their production. A single coupling plays the role of “gene” (elementary part of genotype), which contains all the information related to its production process-types of machinery used and processing time and setup time as well. Coupling data can occur several times depending on the production schedule. Each coupling has its own symbol A, B, C, and so on. Example of genotype - BBAAKAPBPAPCCBOB.

As a unit of the simulation can be treated a chromosome (specific permutations of couplings) supplemented by the number of couplings and the time of the contract of realization. Each permutation with repetitions consists of a maximum of 16 couplings (each has specific lead time depending on the production schedule). Couplings has a symbol of {A,.. P}. The information contained in each simulation unit, allows for the initial selection of randomly generated sequence, due to the evaluation function is which to check whether the execution times of individual couplings are in the schedule of orders (timeOfProduction < timeOfSchedule).

In the first step, the algorithm generates a large number of individuals (thousands of them), then checks their suitability for further simulation through the evaluation function. Those individuals that meet the requirements of the evaluation function are ordered by the objective function, which is to minimize the execution time of the entire order. This is due to the assumption that the plant produces continuously at a constant number of employees (in constant shift mode), thus reducing the total execution time is equivalent to a reduction in the total cost of the order (shorter labor time and cost of production). From the point of view of the simulation the step is called checking the fitness of population.

When the group of sequences with the lowest values of execution time is selected (choose the best 50% of the population by ranking) mutations of the best are made by a small permutation of genes within the chromosome. This change in the order of the production cycle can be done by e.g. conversion of selected pairs of genes locations. The purpose of this mutation is to improve the individual.

The algorithm was written in C++ in VisualStudio2015. The basic classes defined in the library defLineOfCoupling.h. are presented below. The base of algorithm show UML diagram on Fig. 1.

Fig. 1.
figure 1

The UML schema of GA

The most important from genetic simulation point of view is the class chromosome. This class includes all the necessary information on the genotype of the subject, which is the set of genes-couplings c [16] in a particular combination - proper chromosome ch_symbol [3], a set of the number of ordered units numC [16] and a set of lead time sexecT [16]. The chromosome class contains also two tables to store timeIn, timeOut for each coupling production. The Boolean variable chromosomeApproval can be true only if the individual meets the requirements of the schedule of the contract. In the class chromosome is defined totalTime() function, which is a simulation engine, because the lead time is calculated for the specified configuration, which is an essential element to the classification of the individual. In addition, there are defined some save and print functions to store results for each coupling sequence.

Further simulation is based on a random base chromosome reset and finding optimal execution time for its derivatives. At the end of each cycle-used to build a generation-chromosomes are ordered in terms of the objective function, which is the total time of the contract. The best 50% of individuals are used to build the next generation (and so on). The rest of population is generated by mutation procedure. The permutation of the chromosome at the level of 0.25 can form combinations that are relatively different from the original sequence. This allows to find new local extreme(s) of evaluation functions in the space of possible solutions. The usual optimization procedure requires several generations, where have been clearly seen the convergence of evaluation function.

5 Results of the Simulation

In this work simulations for 1000 accepted individuals 3 consecutive generations was carried out. Figure 2 shows an example of the distribution of lead time for output generation. Maximum time is 4827.9 min, the minimum time - 4016.8 min, the average - 4667.25 min and the standard deviation - 152.15 min. It can be observed that the times of execution are repeatable (although the sequences are not the same) and oscillate around a certain characteristic values. The minimum results are sporadic, which justifies the use of simulation in their quest.

Fig. 2.
figure 2

Lead times for randomly generated chromosomes in the first generation. Normalized time periods (bins) ‘0–100’ designated by the principles: the beginning of the time axis ‘0’ means ‘t_min’, the end of the time axis ‘100’ means ‘t_max’, width of each interval equals to ‘tmax − tmin/100’.

The new population is accompanied by a mutated individuals. A mutation scheme proposed is justified by the fact that the order of execution is of utmost importance for the whole time of production. This is due to the fact that if the same coupling (genes) are produced after each other, they do not require retooling of all the machines in the production process of the coupling. Therefore, the sequence ABA is less favorable than AAB. In every generation, individuals subjected to approval because of the timing of contracts evaluation function, then they were sorted from the point of view of execution time of an order. In the next step, individuals were grouped and counted in one hundred periods-bins of the execution time, normalized between minimum and maximum value, each of the same width t_max − t_min/100 and a signed as “0–100”. On this basis execution time histograms were found for each generation, the results are presented in the Fig. 3.

Fig. 3.
figure 3

Histogram of individuals of the first generation (poles), the intermediate generation (solid line), the final generation (solid line points).

In the first generation it can be seen that the histogram bars are not compatible to any known regular distribution, but grouped around three distinct maxima. This is due to the fact that certain tasks in the production cycle of the couplings (genes, their sequences or repetition) have a dominant influence on the total execution time, because of the size of the order and time-consuming production process. Position of such dominant genes determines the total time of the contract. Around these peaks normal distributions is observed, which is associated with less dominant gene permutation (couplings of short runs). In this work, this issue will not be dealt with in detail. It should also be noted that the maximum time found 4827.9 [min] is one of the local maxima of the histogram. In subsequent generations, it can be seen that the rejection of the longest execution time (according to the objective function) leads to moving the histogram peaks towards shorter lead times.

The final sequences with the optimized execution time were occurred in the third generation. In the following sequences the advantageous of mutations was found. The frequent repetition of genes of the same type is present (for example ‘OFFFNNAAIKNCCHFF’), however due to the separation of the repeated tasks (‘F’ appears 5 times in two groups of ‘FFF’ and ‘FF’), one can be expected that further simulations would result in a more favorable solution, but is not obvious.

From 16 production orders, 8 of them decreased in duration due to optimization and downtime. Total downtime for all production orders decreased by 5 753.01 min, which was a decrease of 16.13%. On 11 machines decreased the total size of downtime

It is possible to say that the search for the optimal sequence of production of couplings and minimal execution time, although it is practically impossible from the point of view of analytics (the vast number of potential solutions); it is achievable in the process of genetic algorithm simulation in a relatively short period of time. Conducted research proves that production in small batches seems more optimal. Short sequences of couplings with the same type are better optimized in terms of objective function. Optimal sequences are not necessary strings A, A, A but are distributed between various orders. Cumulated big orders (A+A, F+F+F, N+N) clearly worse they are arranging themselves in optimum sequences. It results from the block of machines in the “cycle for the longer time” and need to wait for the dismissal of machines by other couplings in the queue. Extending downtimes influences for increasing the value of the function of the objective. Accumulated big orders are fulfilling the criterion of purpose in the minute step - 21% orders are only obtaining approval on account of the established completion date resulting from the schedule. For remaining we are dealing with delays and the need to negotiate the new completion dates or to withdraw orders from the production schedule. Methodology drawn up has a few simplifications and of restrictions of the problem on account of the computational complexity and the scale developed referring to the amount of investigated orders during one simulation, considered planning horizons, accepted resulting productive times from production routes. However it is possible to modify existing model and rely on dynamic table with freedom of choice of orders and their production routes and lot sizes without the need of the manual alteration to include software in the model.

Elaborated model can also be appropriately adapted for different production real terms enabling generating the production schedule and the optimization throughputs. It will be necessary to actualize databases with input data and consider new constraints.

6 Conclusions

The developed algorithm can be perceived as universal one and can be easily adopted to changeable lot sizes (orders). Authors also have proved that the method used has a relatively high convergence and simulations for three generations eliminate inefficient solutions. Simulation results received do not always correspond to our intuition and optimal often prove sequences mixed difficult to predict for the production planner.

The use of the model based on genetic algorithm for production scheduling and optimization of batch size production quickly and efficiently generate a production schedule, to determine the sequence of orders and load workstations in such a way that the entire production cycle was minimized downtime on the machines where possible eliminated and the load machinery increased. This represents significant added value compared to traditional methods of production scheduling based on the experience of planners and tools without the possibility of dynamic optimization in terms of a fixed objective function as MS Excel, MS Project. The program, after many random trials can find one acceptable chromosome between 10–50 s (for processor 2,66 MHz). So the simulation of 3,000 chromosomes is about 1,500 min = 25 h of processor work. Calculations can be also performed on a multitask mode on cluster and reduce computing time.

Conducting a simulation using a genetic algorithm allows for the analysis of machines used in the production process following couplings resulting from production orders included in the production schedule. In addition to this analysis is the load of all machines used in production (both analyzed line couplings as well as machines with cooperation). The production process is moved when another machine according to the production route is busy. The waiting period is generated in the form of a report and the information contained under the parameter downtime. Downtime is the norm for further couplings chromosome (they have already designated production cycle previous couplings so waiting for the free device). As a consequence, the total duration of the sequence is determined by: the times resulting from technology - set-up times, cycle time; the size of production batches manufactured and existing downtime on the production line.

Further work should go in the direction of extension of the existing model and its input parameters by entering them into a dynamic array. When operating in dynamic data structures may be that such a structure should be increased or decreased during the program. One can dynamically change the size of the structure taking into account the variable amount of production orders in a single simulation on a regular basis in an integrated way to update the production technology and perform scenario analysis by introducing new engines, new production orders and modifying batch sizes and lead times and taking into account the multi-level structure of products and multi-stage planning production. The model can also be adapted accordingly in the future for other actual production conditions allowing the generation of production scheduling and optimization of production. In such case there is a need to update databases of input parameters and taking into account the limits imposed the new production environment. Without a doubt, this is a helpful tool for efficient production planning for a large number of production orders, the variable range of production with the need to minimize production bottlenecks, minimize inventories of work in progress and to take account of various constraints of time, cost and resource.