Management optimizing the costs and duration time of the process in the production system


 This article proposes a method to support decision making from a cost management perspective in the initial stage of production planning. In a research analyzed the problem of selecting production resources for order realization. The research was based on computer simulation. The developed model focuses on the planning of the production process in the event that the products have not yet been produced and it is necessary to decide where to produce it (with what production resources) so that the total production costs are as low as possible. In this concept, the FlexSim simulation environment with a built-in optimization module was used to solve the problem. The basic steps of simulation model built were discussed, taking into account the necessary information and input data. The results show the impact of the application of selected simulation scenarios on the level of use of production resources, due to the minimization of the total production costs and the duration time of the production process.


Introduction
Expense management is an extremely important issue in any business, regardless of its size or the number of people employed. Spending company money wisely will allow you to optimize costs. And this means nothing more than incurs the lowest possible costs while maintaining a high, or even increasing, level of production or services provided (Klimecka-Tatar et al., 2021;Mazur and Momeni, 2019;Setamanit, 2019).
In the production process management, often a large part of the planning process concerns the selection of the production structure with limited availability of production resources (Matuszny, 2020;Ulewicz and Blaskova, 2018;Ulewicz et al. 2021). The selection of production resources, including the services of subcontractors, is most often made in terms of its efficiency and low costs, high quality of manufactured finished products and safety (Karcz and Ślusarczyk, 2021;Knop, 2019;Krynke et al., 2021;Krynke, 2020;Niciejewska et al., 2021). Therefore, it is important to establish a set of procedures/recommendations for pricing, selecting contractors, and measures to monitor and improve supplier relation. One should also not forget about the management processes of own means of production, their availability and own costs of process maintenance (Ingaldi, 2020;Klimecka-Tatar and Ingaldi, 2020;Ulewicz, 2014).
The development of modern computer technology and many fields of science, especially in the field of production engineering, made it possible to virtually simulate real production processes (Garrido, 2009;Pietraszek et al., 2020). Due to the use of comprehensive IT solutions in the field of modelling and simulation of manufacturing processes, a significant economic benefit is achieved, especially in mass production (Kyncl, 2016). Therefore, more and more IT solutions are appearing in the area of tracking, monitoring and visualizing the course of production processes in real time (Knop, 2020a;Knop, 2020b;Staniszewska et al., 2020;Sujová et al., 2020;Zhuang et al., 2018). Many IT tools are at the disposal of managers today, incl. FlexSim, Ocyave, Matlab/Simulink, Technomatix Plant Simulation, Arena, Enterprise Dynamics, Vensim, Excel/Solver and others.
The effectiveness of the production planning and scheduling processes, in particular at the stage of simulating virtual models of production systems, depends primarily on the mathematical models and optimization algorithms used (Le et al., 2020). In complex production systems, this efficiency is translated primarily into achieving a lower level of production costs, shorter production cycle times with a simultaneous high efficiency of data processing (Kaczmar, 2015). It is also important that the digital model reacts quickly to changes (Kaczmar, 2016).
This article proposes a method to support decision making from a cost management perspective in the initial stage of production planning. The study analyzed the problem of selecting production resources for order realization. The developed model focuses on the planning of the production process in the event that the products have not yet been produced and it is necessary to decide where to produce it (with what production resources) so that the total production costs are as low as possible. In this concept, the 3D FlexSim simulation environment with the built-in OptQuest optimization module was used to solve the problem (FlexSim, 2017).

Literature review
A typical problem often encountered in industry is production planning with limited availability of production resources. This problem relates to the achievement of the set goal with the limited means of production. (Krenczyk et al., 2017). You may find mathematical modelling helpful in making beneficial choices. A mathematical description called a linear programming task can be used to represent many of them. (Krynke and Mielczarek, 2018). In its general form, this task is to find the extreme of a function (called an objective function). Among the various analytical methods used to solve such problems, the most effective is linear programming (Sujová et al., 2018).
The objective is written in the form of a mathematical function called the objective function, the value of which is usually minimized or maximized. In the objective function, there are decision variables that affect the degree of achievement of the assumed objective. In practice, usually limited amounts of resources, most often means of production, are available. These constraints are written in the form of a system of equations and inequalities, where the decision variables satisfy the system of constraining conditions. Decisions that satisfy the system of constraining conditions are called permissible, decisions, and the decision selected from among the permissible decisions, for which the objective function takes the maximum or minimum value, is called the optimal decision (Kaczmar, 2019).
If the objective function is a linear function, and the set of constraining conditions also takes the form of a system of linear equations or inequalities, then such a model is called a linear programming task (Trzaskalik, 2003).
In the case of the problem of choosing the optimal allocation of production tasks, it is necessary to determine which products and in what quantities should be produced. The resources of the means of production available must not be exceeded. It is assumed that the enterprise can produce a certain number of products. Resources are used for their production, e.g. machines, some of which are limited by their availability time. The production efficiency of each product on a given machine is determined. Production prices are also determined depending on the allocated production resources. In real condition, additional restrictive criteria are often required. This can be information related to restrictions on the quantity of the order or the delivery time of manufactured products (Kaczmar, 2016).
The decision variables are the production quantities of different products on different machines. The production assortment that meets the limiting conditions and boundary conditions will be an acceptable solution. The optimal solution is a solution for which the objective function will assume a maximum value for profit or a minimum value for cost or production time.
There are many ways of solving these types of problems graphically or with linear algebra methods in operations research (Jelonek et al., 2020;Jędrzejczyk, Kukuła et al., 2020). A universal method of solving linear programming problems is the simplex method (Kolda et al., 2003). However, it is arduous and laborious.
Optimizing a process by simulation means building a model that reflects the process and finding the best configuration of input fields that find the best response value . Optimization usually consists of maximizing or minimizing a selected parameter (Kaczmar, 2016;Kyncl et al., 2017;Le et al., 2020). After building each simulation model, it should be validated, i.e. its suitability for the selected application should be assessed. If it turns out that the model correctly reflects reality, then only then can we begin designing experiments and further analyze the data (Kaczmar, 2016).
One of the recognized simulation tools is the FlexSim software. FlexSim provides extensive support for the construction of simulation models, analysis and their verification. It was developed by FlexSim Software Products, Inc. FlexSim is fully customizable, graphically oriented simulation software that integrates 3D modelling, simulation and visualization and animation in a 3D object-oriented environment (Kaczmar, 2019). In a simulation system, a discrete or continuous flow is created using predefined modelling objects that are complete parameterized basic elements of model creation. Discrete objects create, send and store elements waiting for implementation, create product flows through the model, group and perform technological operations on products. These objects are used to develop discrete event simulation models in which the behavior of the model results from events occurring at discrete points in time. Predefined objects are available in libraries. In addition, the system offers mechanisms that allow for automatic import and export of data from external sources as well as mechanisms to facilitate data analysis (Drbúl et al., 2016).

Experimental
As part of the research analysis, the following problem of allocation of production tasks to specific production resources was considered. There are 4 machines whose available standard hours of work were given in Table 1. With the help of these machines the production program of five products should be realized. Manufacturing cost (1 hour) of the machine j for the one product i are shown in Table 2. The production of every product can be divided in randomly between the machines.
The hourly productivity of machines depends on which product is produced on a given machine. Individual value was given in Table 1. The production tasks should be allocated to machines in such a way so that the total cost of the realization of the production program is minimal (Krynke and Mielczarek, 2018). This type of problem can be represented by boundary equations (1), constraint conditions (2) and objective functions (3). The decision variables defining the production volume for individual products are Pij elements, where index i means the type of product, and index j means the type of machine on which the given product is produced. [ℎ] (2) The objective function (3) includes optimization criteria regarding the quantity of products: P1, P2, P3, P4, P5 The solution of the problem is to find the quantities Pij, for which the objective function takes the minimum value from the set of allowed decisions.
The key point of any optimization task is to build a valid simulation model. It will allow you to map the process exactly as it actually happens. In the FlexSim simulation environment, most often it is necessary to select the appropriate elements from the object library on the left side of the main program window. These elements "imitate" machines, raw materials or actually manufactured products. The flow logic of the examined process is created by adding appropriate connections that allow the movement of the flow elements, they can be e.g. processed details, as in this case. An exemplary simulation model for solving the discussed problem is shown in Fig. 1.

Fig. 1. Simulation model for the discussed problem
In the model, the following objects can be distinguished: twenty (Source) symbolizing the quantity of Pij products, four machines (Processor) implementing the production of these products and an output (Sink) for each product of a given assortment, counting the production of finished products. Each type of product is simulated by a flow element generated by 4 sources. In this model, the source works in the Arrival Sequence mode. In this particular case, the flow element will symbolize the quantity of the product in question. This is the variable that will be used in the optimization of process, but also this is a place where the optimizer will generate results from subsequent iterations. Because, several types of products are produced, it is a good idea to set the product type in the Source object configuration. This can be done by using the appropriate flow triggers (Beaverstocket et al., 2012).
Each source is in turn connected to a processor simulating the type of machine on which a given product is manufactured. Since the performance of the machines varies with the type of product being produced, this must be taken into account in the runtime configuration for each processor. To do this, use the Values By Case function and set the duration time of each operation. These times will depend on the input ports for the processor. An example of these settings for the first processor is shown in Figure 2.
In order for the finished products leaving the processors, depending on their type, to go to the appropriate output port, the flow logic must be properly configured in the Flow tab. To do this, select the By Expression function. This option will sort the product types according to the types specified when configuring the Source objects.
The OptQuest optimizer (OptTek), built into the FlexSim platform, will be used to solve the sample problem. Its operation is based on neural networks and metaheuristic algorithms (FlexSim, 2017).

Fig. 2. Configuration of the working time of the first workstation (efficiency) for individual products
In the optimizer tab (Scenarios) the input variables should be entered with the use of sampler (Fig. 3). The sampler should indicate Quantity for each Source variable. Boundary conditions and restrictions relating to the batch size and he availability of individual machines should also be provided. The optimizer settings according to the conditions (1-3) are shown in Figure 4. The objective function in this task is minimized as the enterprise is interested in lowering the cost. The optimizer will adjust the number of flow elements until the optimal value is set (constant) -the optimal value is the one at which the operating costs of individual processors will be the lowest.

Results and discussion
As a result of running the model once (the so-called initial simulation), the required data is obtained, which will be used as input information for the optimizer.
The limiting conditions are equations (1), (2), which were introduced as optimizer constraints. The objective function (3) is a single-criteria optimization task that should be minimized. There is one objective function optimization criterion in this task, therefore the Single option should be selected (Fig. 4). With such assumptions, the program searchs for the best solution in the set of permissible decisions. The type Integer was used for all input variables.
The set of solutions generated by the optimizer is shown in Fig. 5. The set of feasible solutions was limited to eight results. These are the points in Fig. 5. Wśród nich znajduje się rozwiązanie optymalne. The bottom line is the limit of the objective function. The best solution is marked with a larger circle (Solution 1). The optimal solution (Solution 1) was found very quickly, already at the first iteration, with the result of 3555.00 monetary units. It is the minimum value of the objective function (production cost) for the constraints set in this task. The results of the best 8 solutions returned by the optimizer are given in Table 3. However, it can be seen that subsequent solutions increase significantly the production costs. It turns out that the most effective for the planned production process will be the production of the product P1 on the M3 machine only, the product P2 on the M1 and M2 machines, the product P3 should be allocated to the M3 and M4 machines, the product P4 for the M2 and P5 machines should be produced on the M2, M3 and M4 machine. For such a planned production structure, the company incurs the lowest production costs of 3555 monetary units. The correct result was obtained and verified with the glpk Solver in the Octave environment (Krynke and Mielczarek, 2018). Figure 6 presents a graph showing the degree of use of individual positions for two scenarios. The first scenario (Fig.  6a) concerns the use of machines with the production plan obtained on the basis of the minimization of the objective function related to the minimization of production costs. The second scenario (Fig. 6b) shows the load of individual machines in the implementation of the production schedule, obtained as a result of minimizing the production time. High use of processor 2 and 3 (Fig. 6a) results from the greater availability time, which for machines 3 and 4 is 90 hours each. In the case of minimizing the production time, simply plan production on machines characterized by the highest efficiency for a given product, while meeting machine availability constraints.
The concept presented above can be the basis for constructing many more complex linear optimization models. It is worth noting that the simulation model and the optimizer work independently, despite being integrated in one package.

Summary and conclusion
The currently used approach to the improvement of manufacturing processes must correspond to contemporary development trends in the field of managing an enterprise operating under the conditions of a market economy. A new generation 3D simulation environment can be used as practical measures to incorporate the company's strategy in the work of the team planning the production process. An example of such a program is FlexSim. It introduces a completely different, better quality of built simulation models as well as their optimization. It is true that other modern calculation programs, such as Excel, Matlab or Octave, also have built-in formulas that enable the so-called search for a result, but they do not have the ability to visualize and observe the process. However in spatial models, in addition to "dry" numerical results, we have the possibility of full visualization of the analyzed phenomenon.
The current trends in production engineering confirm the need and profitability of applying simulations before starting series production (Klimecka-Tatar, 2018).
Based on the analysis of the state of knowledge and the simulation experiment performed, conclusions can be drawn as follows:  The analysis of many variants of planning the production structure, which is previously tested on a simulation model, reduces the risk of ineffective use of machines.  Improvement of the economics of the production structure based on optimization enables faster detection of ineffectiveness of machines and is economically justified. The application of the presented software is not limited to production planning only. The above mathematical model and the method of its solution find application in many engineering issues, logistics and transport.  The presented simulation solution does not require more work than algebraic solutions. Performing a simulation that takes into account many different input parameters is cheaper than the subsequent exchange of a working production line. It also allows you to perform sensitivity analysis in many dimensions, which is not possible with spreadsheets and other similar software.  An important aspect of the use of big data is the visualization of analysis results, including the presentation of trends and other forecasts using appropriate visualization tools. Due to the complexity of big data, conventional data visualization tools and techniques such as tables, bars, and line charts are often insufficient. The main goal of modern data representation methods is to improve the forms of images, diagrams and animations so that they are useful for decision makers.