processes

Article The Use of a Genetic for Sorting Warehouse Optimisation

Patrik Grznár 1 , Martin Krajˇcoviˇc 1 , Arkadiusz Gola 2,* , L’uboslavDulina 1 , Beáta Furmannová 1, Štefan Mozol 1, Dariusz Plinta 3 , Natália Burganová 1, Wojciech Danilczuk 2 and Radovan Svitek 1

1 Department of Industrial Engineering, Faculty of Mechanical Engineering, University of Žilina, Univerzitná 8215/1, 010 26 Žilina, Slovakia; [email protected] (P.G.); [email protected] (M.K.); [email protected] (L’.D.); [email protected] (B.F.); [email protected] (Š.M.); [email protected] (N.B.); [email protected] (R.S.) 2 Department of Production Computerization and Robotization, Faculty of Mechanical Engineering, Lublin University of Technology, ul. Nadbystrzycka 36, 20-618 Lublin, Poland; [email protected] 3 Department of Production Engineering, Faculty of Mechanical Engineering and Science, University of Bielsko-Biala, ul. Willowa 2, 43-309 Bielsko-Biała, Poland; [email protected] * Correspondence: [email protected]; Tel.: +48-81-538-45-35

Abstract: In the last decade, software as a tool for managing and controlling business processes has received a lot of attention. Many of the new software features allow businesses to achieve better quality results using optimisation, such as genetic . This article describes the   use of modelling and simulation in shipment and sorting processes that are optimised by a genetic algorithm’s involvement. The designed algorithm and simulation model focuses on optimising the Citation: Grznár, P.; Krajˇcoviˇc,M.; duration of shipment processing times and numbers of workers. The commercially available software Gola, A.; Dulina, L’.;Furmannová, B.; Tecnomatix Plant Simulation, paired with a genetic algorithm, was used for optimisation, decreasing Mozol, Š.; Plinta, D.; Burganová, N.; Danilczuk, W.; Svitek, R. The Use of a time durations, and thus selecting the most suitable solution for defined inputs. This method has Genetic Algorithm for Sorting produced better results in comparison to the classical heuristic methods and, furthermore, is not Warehouse Optimisation. Processes as time consuming. This article, at its core, describes the algorithm used to determine the optimal 2021, 9, 1197. https://doi.org/ number of workers in sorting warehouses with the results of its application. The final part of this 10.3390/pr9071197 article contains an evaluation of this proposal compared to the original methods, and highlights what benefits result from such changes. The major purpose of this research is to determine the number of Academic Editors: José Barbosa and workers needed to speed up the departure of shipments and optimise the workload of workers. Luis Puigjaner Keywords: computer simulation; genetic algorithm; shipment; sorting; optimisation; logistic Received: 2 June 2021 Accepted: 7 July 2021 Published: 10 July 2021 1. Introduction Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in The shipping industry is still figuring out how to manage its processes in a cost- published maps and institutional affil- effective and efficient manner. As a result, several delivery companies seek out cutting-edge iations. solutions to improve customer experience and revenues [1,2]. Whether it is a company with a large or small volume of shipments, it is always necessary to adhere to specific transport standards of, and solutions to, the sorting process. A delivery company often stands as a link between a product’s manufacturer and customers [3]. Such a company will ensure customer satisfaction mainly by fast delivery, suitable packaging of the consignment Copyright: © 2021 by the authors. Licensee MDPI, Basel, Switzerland. and, last but not least, the lowest price. This is why it is crucial to continually improve said This article is an open access article company’s logistics processes [4,5]. In a delivery company, every process is closely linked; distributed under the terms and it must therefore respond flexibly to every change and error in the process [6]. This means conditions of the Creative Commons that the delay of one element of a shipment and sorting processes will be reflected in the Attribution (CC BY) license (https:// next process [7,8]. creativecommons.org/licenses/by/ Today, modelling and are commonly used for all production or logistics 4.0/). companies [9,10]. Due to the sensitivity of delivery processes, finding the optimal solution

Processes 2021, 9, 1197. https://doi.org/10.3390/pr9071197 https://www.mdpi.com/journal/processes Processes 2021, 9, x FOR PEER REVIEW 2 of 14

Processes 2021, 9, 1197 2 of 13 Today, modelling and simulations are commonly used for all production or logistics companies [9,10]. Due to the sensitivity of delivery processes, finding the optimal solution withwith the the highest highest possible possible quality quality is is necessary necessary [11,12]. [11,12]. Simulation Simulation can can be be especially especially useful useful inin cases cases involving involving a acomplex complex system system with with dynamic dynamic inputs inputs and and conditions conditions [13,14]. [13,14 It]. can It canbe usedbe used not notonly only for forthe thedetermination determination of ofa future a future object’s object’s state state but but also also to to determine determine the the optimaloptimal path path to to achieve achieve this this state state [15,16]. [15,16]. Genetic Genetic algorithms algorithms (GA) (GA) are are commonly commonly used used to to generategenerate high-quality high-quality solutions, solutions, as as well well as as to to optimise optimise and and search search for for problems problems by by relying relying onon biologically biologically inspired inspired operators operators such such as as mu mutations,tations, crossover, crossover, and and selection selection [17,18]. [17,18]. The The advantagesadvantages of of such such algorithms algorithms include, include, for for example, example, the the ability ability to toimplement implement GAs GAs as asa “universala “universal optimiser” optimiser” that that can canbe used be used to optimise to optimise any anytype typeof problem of problem belonging belonging to dif- to ferentdifferent areas areas [19,20]. [19, 20Genetic]. Genetic algorithms algorithms in the in field the field of logistics of logistics are an are area an areaof interest of interest for manyfor many researchers. researchers. Figure Figure 1 presents1 presents the thenumb numberer of publications of publications on genetic on genetic algorithm algorithm is- suesissues in the in the context context of logistics of logistics (based (based on ondata data from from the the Scopus Scopus database). database).

FigureFigure 1. 1. NumberNumber of of publications publications on on genetic genetic algorithms algorithms and and logistics. logistics.

AsAs will will be be demonstrated demonstrated further, further, this technique cancan solvesolve practical practical problems problems that that occur oc- curin logisticsin logistics companies. companies. This This technique technique has ha tremendouss tremendous efficiency efficiency and and performs performs well well in creating complex adaptations. A GA can find elegant, multifactorial solutions to problems in creating complex adaptations. A GA can find elegant, multifactorial solutions to prob- in hidden ways, problems that a researcher may be unaware of and that are unlikely to be lems in hidden ways, problems that a researcher may be unaware of and that are unlikely discovered by traditional engineering approaches [21,22]. to be discovered by traditional engineering approaches [21,22]. Based on [23], the selection of model structure and model parameter identification are Based on [23], the selection of model structure and model parameter identification two main problems in system identification. There is currently a growing number of uses of are two main problems in system identification. There is currently a growing number of genetic algorithms to solve various tasks because of its advantages, such as wide adaptabil- uses of genetic algorithms to solve various tasks because of its advantages, such as wide ity, stable calculation, high identification accuracy, and simultaneous determination of the adaptability, stable calculation, high identification accuracy, and simultaneous determi- model structure and parameters. A linear system, system order, time lag, and parameters nation of the model structure and parameters. A linear system, system order, time lag, can be constituted into a chromosome. The value of fitness function includes the modelling and parameters can be constituted into a chromosome. The value of fitness function in- error thanks to the system identification problem becoming an optimal problem that a GA cludes the modelling error thanks to the system identification problem becoming an opti- can solve. mal problemThere are that many a GA areas can wheresolve. genetic algorithms find application in optimisation, such as artificialThere are intelligence many areas [24 where], robotics genetic [25 algorithms], services find [26], application automatic controlin optimisation, [27], manufac- such asturing artificial [28], intelligence and warehouses. [24], robotics Genetic [25], algorithms services are [26], used automatic in warehouses control in[27], various manufac- ways, turingsuch as[28], solving and warehouses. problems related Genetic to the algorithms utilisation are of used material in warehouses items’ locations, in various determining ways, suchthe appropriateas solving problems inventory related size of individualto the utilis materialation of items,material and items’ determining locations, the determin- speed and ingschedule the appropriate of the replenishment inventory size of material of individual items [ 29material]. By testing items, the and genetic determining algorithm the in speedterms and of replenishment schedule of the of replenishment stocks, it was found of ma thatterial as items little time[29]. asBy possible testing wasthe genetic devoted al- to gorithmthis task in [30 terms,31]. Optimisationof replenishment to find of thestocks, optimal it was placement found that solution as little can time be found as possible in [32]. wasOptimisation devoted to of this the task AGV [30,31]. route inOptimisation warehouses to was find carried the optimal out in placement [33,34]. solution can be found in [32]. Optimisation of the AGV route in warehouses was carried out in [33,34].

Processes 2021, 9, 1197 3 of 13

Problem Definition For the solution and subsequent optimisation, the problem of determining the number of personnel in a consignment sorting warehouse is chosen. Siemens’ Tecnomatix Plant Simulation 15.2 software is used to implement the solution. The quantity of sorting volume in a warehouse is not constant and tends to fluctuate depending on the volume of shipments on any given day. As a result, a warehouse is used by both permanent employees and largely part-time workers who are ordered in a fixed number every day. It is never certain how many temporary workers will be required on any one day. 4 h before sorting begins, the quantity of consignments received is known. Every day, it is required to ensure that sorted consignments are loaded onto transport trailers as soon as possible in both directions. Using a routine estimate to optimise the amount of personnel for a complex sorting facility on a daily basis is a difficult assignment. It is assumed that a large number of people are completing jobs at maximum capacity; therefore, leaving trucks with sorted items is the best option. The goal of this research is to develop a system for determining the number of workers and inputs for a given day, while allowing each truck to depart from the sorted consignments first. According to the proposed algorithm, the results are calculated for a specified volume of consignments. On the basis of this optimisation, a simulation model of a shipment sorting warehouse is used, with genetic algorithms being used to reduce the number of experiments. The article’s main purpose is to highlight the advantages that optimisation in the form of simulation using genetic algorithms can offer to the stated case study of applied research in a sorting depot. The fundamental goal of optimisation is to obtain the most feasible time structure for sorting processes while maximising the utilisation of labour resources. The result is a process for determining the number of workers for the sorting depot for a certain number of shipments at various time intervals, using genetic algorithms to construct simulation experiments.

2. Materials and Methods 2.1. Genetic Algorithms A genetic algorithm (GA) was employed to determine the best solution for various processes in the simulation model, as previously described. One of the most basic stochas- tic optimisation techniques with considerable evolutionary characteristics is the genetic algorithm. To solve a problem, it represents an intelligent use of random selection from a defined search space. A GA solves multiple tasks concurrently, allowing for a global search for the best solution. It is currently the most extensively used evolutionary optimi- sation algorithm, with several theoretical and practical applications. The genetic algorithm considers five steps [28].

2.1.1. First Phase: Initial Population The procedure starts with a group of people known as a population. Each person is the answer to the problem one is trying to solve. Genes are a set of factors that characterise an individual. A chromosome is made up of genes that are connected together. A set of an individual’s genes is represented by a string in the form of an alphabet in a genetic algorithm. Binary values are commonly utilised. On a chromosome, we claim we encode genes [21].

2.1.2. Second Phase: Fitness Function The fitness function determines an individual’s level of fitness. It assigns a fitness score to each individual. The likelihood of an individual being chosen for reproduction is determined by their fitness score [35].

2.1.3. Third Phase: Selection The goal of the selection phase is to choose the most capable individuals and allow them to pass on their genes to future generations. Two pairs of people (parents) are chosen Processes 2021, 9, x FOR PEER REVIEW 4 of 14

Processes 2021, 9, x FOR PEER REVIEW 4 of 14

2.1.3. Third Phase: Selection

Processes 2021, 9, 1197 2.1.3.The Third goal Phase: of the Selection selection phase is to choose the most capable individuals and allow4 of 13 themThe to pass goal on of their the genesselection to future phase generations. is to choose Twothe most pairs capable of people individuals (parents) are and chosen allow dependingthem to pass on on their their fitness genes levels. to future Physically generations. fit individuals Two pairs have of people a better (parents) likelihood are chosen of de- cidingdependingdepending to reproduce on ontheir their fitness[35]. fitness levels. levels. Physically Physically fit individuals fit individuals have havea better a better likelihood likelihood of de- of cidingdeciding to reproduce to reproduce [35]. [35]. 2.1.4. Crossover 2.1.4. Crossover 2.1.4.Crossover, Crossover the most essential phase of the genetic algorithm is shown in Figure 2. A crossingCrossover,Crossover, point is the chosen the most most at essential random essential phase from phase ofthe ofthe genes the genetic genetic for algorithmeach algorithm pair ofis isparentsshown shown in to inFigure be Figure mated. 2.2 A.A Progenycrossingcrossing arepoint point created is ischosen chosenby exchanging at atrandom random genes from from betweenthe the genes genes parents for for each eachuntil pair paira cut-offof ofparents parents point to is tobe reached. bemated. mated. TheProgenyProgeny population are are created created grows by by exchanging adding exchanging new genes genesprogeny between between [35]. parents parents until until a cut-off a cut-off point point is reached. is reached. TheThe population population grows grows by by adding adding new new progeny progeny [35]. [35 ]. Parent 1 KRTAS JOSRWA RI MUZDWQST Parent 1 KRTAS JOSRWA RI MUZDWQST Parent 2 NRQIE PGECVI BC LXWTMIPQ Parent 2 NRQIE PGECVI BC LXWTMIPQ

Children 1 KRTAS PGECVI RI LXWTMIPQ Children 1 KRTAS PGECVI RI LXWTMIPQ Children 2 NRQIE JOSRWA BC MUZDWQST

Children 2 NRQIE JOSRWA BC MUZDWQST Figure 2. Crossover. FigureFigure 2. Crossover. 2. Crossover. 2.1.5. Mutation 2.1.5.2.1.5.Some Mutation Mutation of their genes may be altered with a low random frequency in newly generated offspringSomeSome (Figure of oftheir their 3). genes Some genes may bits may be in bealtered a alteredbit-string with with acan low a lowbe random reversed random frequency frequencyas a result in innewlyof newlythis generatedmutation generated [22].offspringoffspring (Figure (Figure 3).3). Some Some bits bits in in a bit-string cancan bebe reversed reversed as as a resulta result of of this this mutation mutation [ 22 ]. [22]. Parent 1 K R T A S J O S R W A R I M U Z D W Q S T Parent 1 K R T A S J O S R W A R I M U Z D W Q S T Parent 2 N R Q I E P G E C V I B C L X W T M I P Q Parent 2 N R Q I E P G E C V I B C L X W T M I P Q

Children N R Q I S J G S R V I B I L U Z T M Q S Q Children N R Q I S J G S R V I B I L U Z T M Q S Q

Mutation

Mutation FigureFigure 3. Mutation. 3. Mutation. Figure2.1.6. 3. TecnomatixMutation. Plant Simulation and Genetic Algorithms 2.1.6. Tecnomatix Plant Simulation and Genetic Algorithms 2.1.6. TecnomatixTecnomatix Plant Plant Simulation Simulation and is a Genetic Siemens Algorithms PLM Software computer tool for the mod- elling,Tecnomatix simulation, Plant analysis, Simulation visualisation, is a Siemens and PLM optimisation Software ofcomputer manufacturing tool for systems the mod- and Tecnomatix Plant Simulation is a Siemens PLM Software computer tool for the mod- elling,processes, simulation, as well analysis, as material visualisation, flow and and logistical optimisation operations. of manufacturing It also enables systems the virtual and de- processes,elling,vice modelsimulation, as towell be analysis,as coupled material withvisualisation, flow real-world and logi and plantstical optimisation management operations. of manufacturing inIt orderalso enables to imitate systems the real-world virtual and deviceprocesses,production. model as wellto Control, be as coupled material , with flow real-world materialand logi transport,sticalplant operations.management and the It full inalso technicalorder enables to imitate operation the virtual real- may worlddeviceall be production. model tested andto be optimisedControl, coupled automation, usingwith real-world this integrated material plant simulationtransport, management and approach. thein orderfull The technical to fundamentals imitate opera- real- of tionworldgenetic may production. all algorithms be tested Control, inand Tecnomatix optimised automation, software using material this are integrated the transport, same assimulation inand biology. the full approach. The technical most The successful opera- fun- damentalstionsolutions may all of arebe genetic tested chosen algorithms and from optimised a pool in Tecnomatix ofusing potential this integratedsoftware solutions are simulation and the used same toapproach. as develop in biology. The new fun-The ones. mostdamentalsThen, successful in of future genetic solutions generations, algorithms are chosen better in Tecnomatix from solutions a pool aresoftware of developed. potential are the solutions The same so-called as and in biology. used fitness to value,Thede- velopmostwhich successfulnew the ones. simulation Then,solutions in model future are chosen provides,generations, from determines a better pool solutionsof whetherpotential are the solutions developed. proposed and The solution used so-called to has de- an fitnessvelopadvantage new value, ones.in which selection Then, the in and simufuture determineslation generations, model whether provides, better it issolutions then determ employed areines developed. whether to create the The anew proposed so-called solution. fitnessThe simulationvalue, which model the showssimulation one how model long provides, each proposed determ sequenceines whether takes the to processproposed [36 ]. The key benefits of genetic algorithms are that they are job-agnostic and produce satisfactory results. As a result, genetic algorithms are well suited to assisting numerous simulation-based optimisation tasks. Genetic algorithms can handle a variety of problems Processes 2021, 9, x FOR PEER REVIEW 5 of 14

solution has an advantage in selection and determines whether it is then employed to create a new solution. The simulation model shows one how long each proposed sequence takes to process [36]. Processes 2021, 9, 1197 The key benefits of genetic algorithms are that they are job-agnostic and produce5 of sat- 13 isfactory results. As a result, genetic algorithms are well suited to assisting numerous sim- ulation-based optimisation tasks. Genetic algorithms can handle a variety of problems withoutwithout requiring requiring a a lot lot of of time time to to construct construct and and adjust adjust simulation simulation models. models. ToTo solve solve the the optimisationoptimisation challenge, challenge, genetic genetic algorithms algorithms employ employ an an iterative iterative approach. approach. The The simulation simulation modelmodel determines determines the the acceptability acceptability of of offered offered solutions solutions based based on statedon stated fitness fitness parameters. parame- Theters. optimal The optimal solution solution is determined is determined when when the optimisation the optimisation cycles cycles are completed are completed and it and is readyit is ready to be usedto be for used future for modelling.future modelling. The objects The displayedobjects displayed in Figure in4 areFigure made 4 possibleare made by further genetic algorithms, see Figure4. possible by further genetic algorithms, see Figure 4.

FigureFigure 4. 4.Objects Objects which which provide provide genetic genetic algorithms algorithms in in software software Tecnomatix Tecnomatix Plant Plan Simulation.t Simulation.

2.2.2.2. Design Design of of Algorithm Algorithm for for Determining Determining the the Number Number of of Workers Workers in in the the Sorting Sorting Warehouse Warehouse Using GeneticUsing Genetic Algorithms Algorithms TheThe casecase studystudy is conducted conducted using using the the algo algorithmrithm for for determining determining the the number number of em- of employeesployees in inthe the sorting sorting warehouse warehouse (Figure (Figure 5),5), in whichwhich thethe targettarget function function is is the the departure departure timetime of of the the final final truck truck with with sorted sorted consignments consignments and and the the number number of of employees. employees. Start Start 1 1 and and StartStart 2 2 are are the the two two beginnings beginnings of of the the algorithm. algorithm. Start Start 1 is 1 theis the first first step step in the in the project project and and its purposeits purpose is to is generate to generate a viable a viable and and verified verified model model using using Tecnomatix Tecnomatix Plant Plant Simulation’s Simulation’s GAWizardGAWizard function function (gray). (gray). StartStart 22 isis usedused byby thethe useruser on on a a daily daily basis basis to to calculate calculate the the numbernumber of of workers workers required required for for a a given given day day so so that that the the truck truck can can leave leave as as soon soon as as feasible, feasible, andand thethe designated workers’ workers’ workload workload is is as as high high as aspossible possible (white). (white). The task The of task the of colour the colourgenetic genetic algorithm, algorithm, which which is marked is marked in blue, in is blue, to arrange is to arrange experiments experiments and conduct and conduct simu- simulation runs. lation runs. 2.3. Design of Simulation Model As already mentioned, the software Tecnomatix Plant Simulation 15.2 is used to implement the simulation model. It enables the insertion of items and their modelling so that the modelled objects are comparable in size and shape to the real ones, allowing for extremely accurate distance and time estimates. It also has a worker function, which allows researchers to replicate the worker’s behaviour and actions (sorting, carrying, unloading, loading). The main part of the simulation model is the conveyor system, which distributes consignments to the sorters and, subsequently, to the conveyors and the transport trailers (see Figure6). There are three critical input locations for shipments for sorting in the model. Input 1 reflects courier-imported shipments. Input 2 is the location where letter items are entered. Input 3 is the input of shipments from a single shipper, but in bigger quantities. Consign- ments imported by trucks for sorting from different locations are represented by inputs 4, 5 and 6. Without simulation, it is decided which worker performs a specific activity. Their present estimate is 21; however, their utilisation is extremely low due to a lack of work coordination on activities. When modelling inputs 4, 5, and 6, it is assumed that no more than three trucks can unload at the same time, see Figure7. Point outputs 7 to 16 are workers who were assigned to remove the consignment off the conveyor belt, inspect it, and place it in the loaded truck. After validation and verification, a simulation model was developed based on the present state, which included all necessary objects and exhibited appropriate accuracy. The model is displayed in 2D view on Figure8a and in 3D view on Figure8b. The time in which the simulation can be run is one of the model’s primary constraints. The moment when the quantity of bales for each direction is known, as well as the estimated arrival time of the sorting trucks, which occurs 4 h prior to the beginning of sorting process. We can rely on past data up to this point, but they do not produce reliable findings. Processes 2021Processes, 9, 1197 2021, 9, x FOR PEER REVIEW 6 of 14 6 of 13

Start 1

Creating simulation model

Determine target function Validated and verified (loading time of last truck, Start 2 simulation model number of workers)

Determine daily inputs Determine number of Actualisation of simulation (shipment on different generation and observations model base on daily inputs routs and arrival time)

Determine of target function direction (up, down)

Simulation of the updated Initialise population of Change of number of Select individuals for the simulation model (fitness workers workers next generation function calculating)

Mutate the resulting Evaluate each candidate offspring

Termination condition satisfied ? Recombine pairs of Select parents (number of N parents generations)

Y

Determine best fitness and select number of workers for specified day

End Processes 2021, 9, x FOR PEER REVIEW 7 of 14

Figure 5. Genetic algorithms are used in a simulation to determine the number of workers in a sorting warehouse. Figure 5. Genetic algorithms are used in a simulation to determine the number of workers in a sorting warehouse. 2.3. Design of Simulation Model Output 16 As alreadyOutpu t 17 mentioned, the software Tecnomatix Plant Simulation 15.2 is used to im- LV_KN Input 1 plement the simulation model. It enables the insertion of items and their modelling so thatInput 2 the modelled objects are comparable in size and shape to the real ones, allowing for ex-depo tremely accurate distance and time estimates. It also has a worker function, which allows researchers to replicate the worker’s behaviour and actions (sorting, carrying, unloading, loading). The main part of the simulation model is the conveyor system, which distributes

consignments to the sorters and, subsequently, to the conveyors and the transport trailersInput 3 (see Figure 6). Oncler_ shipment

Input 4-5-6 Outpu t 15 Outpu t 11 Outpu t 9 Output 14 Outpu t 13 Output 12 Outpu t 10 Outpu t 8 Outpu t 7 oversize Put_from_truck

KE MI LM SN PP TN_PD TT_SE DS BA Figure 6. ConveyorConveyor system system of sorting in the warehouse and workplaces.

There are three critical input locations for shipments for sorting in the model. Input 1 reflects courier-imported shipments. Input 2 is the location where letter items are en- tered. Input 3 is the input of shipments from a single shipper, but in bigger quantities. Consignments imported by trucks for sorting from different locations are represented by inputs 4, 5 and 6. Without simulation, it is decided which worker performs a specific ac- tivity. Their present estimate is 21; however, their utilisation is extremely low due to a lack of work coordination on activities. When modelling inputs 4, 5, and 6, it is assumed that no more than three trucks can unload at the same time, see Figure 7. Point outputs 7 to 16 are workers who were assigned to remove the consignment off the conveyor belt, inspect it, and place it in the loaded truck.

Figure 7. Loading of shipments into the truck after sorting.

After validation and verification, a simulation model was developed based on the present state, which included all necessary objects and exhibited appropriate accuracy. The model is displayed in 2D view on Figure 8a and in 3D view on Figure 8b. The time in which the simulation can be run is one of the model’s primary constraints. The moment when the quantity of bales for each direction is known, as well as the estimated arrival time of the sorting trucks, which occurs 4 h prior to the beginning of sorting process. We can rely on past data up to this point, but they do not produce reliable findings.

Processes 2021, 9, x FOR PEER REVIEW 7 of 14

Output 16 Outpu t 17

LV_KN Input 1 Input 2 depo

Input 3 Oncler_ shipment

Input 4-5-6 Outpu t 15 Outpu t 11 Outpu t 9 Output 14 Outpu t 13 Output 12 Outpu t 10 Outpu t 8 Outpu t 7 oversize Put_from_truck

KE MI LM SN PP TN_PD TT_SE DS BA Figure 6. Conveyor system of sorting in the warehouse and workplaces.

There are three critical input locations for shipments for sorting in the model. Input 1 reflects courier-imported shipments. Input 2 is the location where letter items are en- tered. Input 3 is the input of shipments from a single shipper, but in bigger quantities. Consignments imported by trucks for sorting from different locations are represented by inputs 4, 5 and 6. Without simulation, it is decided which worker performs a specific ac- tivity. Their present estimate is 21; however, their utilisation is extremely low due to a lack of work coordination on activities. When modelling inputs 4, 5, and 6, it is assumed that no more than three trucks can unload at the same time, see Figure 7. Point outputs 7 to 16 Processes 2021, 9, 1197 are workers who were assigned to remove the consignment off the conveyor belt, inspect7 of 13 it, and place it in the loaded truck.

Processes 2021, 9, x FOR PEER REVIEW 8 of 14

Figure 7. Loading of shipments into the truck after sorting. Figure 7. Loading of shipments into the truck after sorting. After validation and verification, a simulation model was developed based on the present state, which included all necessary objects and exhibited appropriate accuracy. The model is displayed in 2D view on Figure 8a and in 3D view on Figure 8b. The time in which the simulation can be run is one of the model’s primary constraints. The moment when the quantity of bales for each direction is known, as well as the estimated arrival time of the sorting trucks, which occurs 4 h prior to the beginning of sorting process. We can rely on past data up to this point, but they do not produce reliable findings.

(a)

(b)

Figure 8. Actual simulation model: ( a) 2D view; ( b) 3D view.

In total, 8330 consignments were used as an input to compare the current condition in terms of the number of workers and truck departure times. The daily cost for one per- manent employee is EUR 9 and, for part-time employees, it is EUR 6. The cost of failing to arrive at the next processing location on time is EUR 6 each minute. The departure of the last sorted vehicle at 5 h 40 min 00 s is the period that should not be exceeded in order to avoid these fees. Without the simulation model, the number of employees was calculated using a conventional estimate based on the table, which shows that there are seven em- ployees for every 1500 shipments. As a result, 42 staff are ready to participate in the sim- ulation. The end of the simulation with this number is 5 h 28 min 53.42 s and the occu- pancy rate is 20%, according to the results. The GAWizard function in the software allows one to define the target function, which is the value that should be optimised and weighted. The loading time of the last truck, i.e., the time when the simulation is finished, and the number of personnel were our two functions. At each simulation run, we aimed for the smallest possible number of personnel and the soonest possible truck departure of the last truck. A fitness function was established. When optimising the last track’s depar- ture time, the number of workers had a weight of 1 while optimising the last track’s de- parture time had a weight of 0.5. In order to optimise the number of employees, integer variables representing em- ployees were constructed. Their number corresponded to the zone in which they engaged

Processes 2021, 9, 1197 8 of 13

In total, 8330 consignments were used as an input to compare the current condition in terms of the number of workers and truck departure times. The daily cost for one permanent employee is EUR 9 and, for part-time employees, it is EUR 6. The cost of failing to arrive at the next processing location on time is EUR 6 each minute. The departure of the last sorted vehicle at 5 h 40 min 00 s is the period that should not be exceeded in order to avoid these fees. Without the simulation model, the number of employees was calculated using a conventional estimate based on the table, which shows that there are seven employees for every 1500 shipments. As a result, 42 staff are ready to participate in the simulation. The end of the simulation with this number is 5 h 28 min 53.42 s and the Processes 2021, 9, x FOR PEER REVIEW 9 of 14 occupancy rate is 20%, according to the results. The GAWizard function in the software allows one to define the target function, which is the value that should be optimised and weighted. The loading time of the last truck, i.e., the time when the simulation is finished, andin a the certain number set of personnelactivities. wereThe zones our two that functions. were optimised, At each simulationas well as run,theirwe activities, aimed for are thedepicted smallest in possibleTable 1. number of personnel and the soonest possible truck departure of the last truck. A fitness function was established. When optimising the last track’s departure time,Table the 1. Range number of activities of workers in different had a weight zones. of 1 while optimising the last track’s departure time had a weight of 0.5. ZoneA ZoneB ZoneC ZoneD In order to optimise the number of employees, integer variables representing employ- ees wereCarry_SN constructed. TheirCarry_BA number corresponded carry_dep_I to the zone in whichSorting_oversize they engaged in Carry_TN_PD Carry_DS Carry_in- a certain set of activities. The zones that werecarry_depo_II optimised, as well as their activities, are depictedCarry_PP in Table 1. put_from_track_A Carry_TT_SE Carry_in- Carry_LM carry_depo_III Table 1. Range of activities in different zones. put_from_track_C Delivery_oversize Carry_in- Carry_MIZoneA ZoneB carry_depo_IVZoneC ZoneD put_from_track_B Carry_SN Carry_BA carry_dep_I Sorting_oversize Carry_TN_PD carry_oncler_ship- Carry_TN_PDCarry_PPCarry_KE Carry_DS carry_depo_II Carry_input_from_track_A Carry_LM Carry_TT_SE carry_depo_IIIment Carry_input_from_track_C Carry_MI Delivery_oversizeCarry_PP carry_depo_IVCarry_in- Carry_input_from_track_B Carry_LV_KNCarry_KE Carry_TN_PD carry_oncler_shipment Carry_LV_KN Carry_PP Carry_input_from_track_Aput_from_track_A Carry_BACarry_BA Carry_DS Carry_DS

TheThe genetic genetic algorithm algorithm can can identify identify the the best best fitness fitness function, function, i.e., i.e., the the combination combination of of factorsfactors that that result result in in the the best best fitness fitness by by combining combining the the number number of of variables. variables. In In the the models, models, therethere are are variables variables that that change change and and variables variables that that do do not not change. change. Figure Figure9 9depicts depicts constant constant variablesvariables on on the the right right and and altered altered variables variables on on the the left. left.

FigureFigure 9. 9.Current Current setting setting of of the the number number of of employees employees in in the the proposed proposed variables. variables.

TheseThese variables variables are are set set in in the the GAWizard GAWizard as as “problem “problem definition”, definition”, where where we we specify specify thethe lower lower (1) (1) and and upper upper (10) (10) number number of of workers workers and and the the increment increment step step (1) (1) for for each each zone. zone. TheThe increment increment step step defines defines how how many many experiment experiment simulations simulations we we attain. attain. The The number number of of observationsobservations is is also also defined, defined, namely namely 3, 3, as as is is the the number number of of generations generations (20). (20).

3.3. Results Results UsingUsing genetic genetic algorithms, algorithms, optimisation optimisation was was started started based based on the on input the data.input Thedata. value The isvalue checked is checked after each after simulation, each simulation, and another and another experiment experiment was constructed, was constructed, reducing reducing the the number of experiments. With a total of 960 simulation runs completed for 320 experi- ments with three observations, each generation improved. Without the use of genetic al- gorithms, 10,000 experiments with three observations would have to be performed. Figure 10 shows the development of fitness values for the best, average, and worst solutions in each generation. Graphs in Figure 11 show all fitness values for each generation.

Processes 2021, 9, 1197 9 of 13

number of experiments. With a total of 960 simulation runs completed for 320 experiments with three observations, each generation improved. Without the use of genetic algorithms, 10,000 experiments with three observations would have to be performed. Figure 10 shows Processes 2021, 9, x FOR PEER REVIEWthe development of fitness values for the best, average, and worst solutions in each genera-10 of 14 Processes 2021, 9, x FOR PEER REVIEW 10 of 14 tion. Graphs in Figure 11 show all fitness values for each generation.

Figure 10. Graph showing the development of fitness values for the best, average, and worst solu- Figure 10. Graph showing the development of fitness values for the best, average, and worst solution Figuretion in10. each Graph generation. showing the development of fitness values for the best, average, and worst solu- tionin each in each generation. generation.

(a) (b) (a) (b) Figure 11. Graph showing all fitness values for each generation: (a) for generation 1 to 10; (b) for generation 11 to 20. FigureFigure 11. 11. GraphGraph showing showing all all fitness fitness valu valueses for for each each generation: generation: ( (aa)) for for generation generation 1 1 to to 10; 10; ( (bb)) for for generation generation 11 11 to to 20. 20. For the 16 core CPU, the simulation and planning of the tests using genetic algo- ForFor the the 16 corecore CPU,CPU, the the simulation simulation and and planning planning of theof the tests tests using using genetic genetic algorithms algo- rithms took a total of 0 h 21 min 20 s. If all 10,000 experiments are carried out, the simula- rithmstook a took total a of total 0 h of 21 0 minh 21 20min s. 20 If alls. If 10,000 all 10,000 experiments experiments are are carried carried out, out, the the simulation simula- tion takes 11 h 06 min 40 s, which is insufficient if temporary staff must be reserved tiontakes takes 11 h 11 06 minh 06 40min s, which40 s, which is insufficient is insufficient if temporary if temporary staff must staff be reservedmust be promptly.reserved promptly. When compared to the standard simulation 10 h 45 min 20 s, genetic algorithms promptly.When compared When compared to the standard to the simulationstandard simulation 10 h 45 min 10 20h 45 s, geneticmin 20 s, algorithms genetic algorithms save time save time (see Figure 12). In terms of costs, the company employs four regular employees save(see time Figure (see 12 Figure). In terms 12). In of terms costs, of the costs, company the company employs employs four regular four regular employees employees and a and a few day-to-day recruits. Costs for staff, temporary workers, and delaying the de- andfew a day-to-day few day-to-day recruits. recruits. Costs Costs for staff, for temporarystaff, temporary workers, workers, and delaying and delaying the departure the de- parture of the truck with sorted consignments make up the resulting costs. Costs are used partureof the truckof the withtruck sorted with sorted consignments consignments make make up the up resultingthe resulting costs. costs. Costs Costs are are used used as as a benchmark. asa benchmark.a benchmark.

Processes 2021, 9, x FOR PEER REVIEW 11 of 14 Processes 2021, 9, 1197 10 of 13

(a)

(b)

FigureFigure 12. 12.(a) (Aa) time-consuming A time-consuming simulation simulation run run without without genetic genetic algorithms algorithms and and a simulation a simulation run run withwith genetic genetic algorithms; algorithms; (b) (theb) the cost cost of the of the best, best, average, average, and and worst worst solutions solutions for for generations. generations.

AfterAfter implementing implementing the the experiments, experiments, a table a table of the of the best best solutions solutions was was generated, generated, with with thethe corresponding corresponding values values of offitness fitness shown shown in inTable Table 2.2 .

Table 2. BestTable result 2. inBest optimisation result in optimisation using genetic using algorithms genetic algorithmsfor three observations. for three observations.

Fitness End of the Simulation End Number of the of EmployeesNumber of Costs (EUR) Fitness Costs (EUR) 2:43:23.5794 5:26:07.1587 Simulation 20 Employees 451.11 2:42:49.5336 2:43:23.57945:24:59.0671 5:26:07.1587 20 20 451.00 451.11 2:43:01.1835 2:42:49.53365:25:22.3670 5:24:59.0671 20 20 451.03 451.00 2:43:01.1835 5:25:22.3670 20 451.03 The specified number of workers for each zone is shown in Table 3. The specified number of workers for each zone is shown in Table3. Table 3. Specified number of workers for different zones. Table 3. Specified number of workers for different zones. ZoneA ZoneB ZoneC ZoneD 10ZoneA 2 ZoneB ZoneC1 ZoneD3 10 2 1 3 With the stated distribution, the workload is reduced by 25%. Utilisation cannot be used as a performance metric because greater values can only be achieved by reducing With the stated distribution, the workload is reduced by 25%. Utilisation cannot be used as a performance metric because greater values can only be achieved by reducing

Processes 2021, 9, 1197 11 of 13

the number of personnel or changing the arrival time of trucks for sorting, both of which are impossible.

4. Conclusions Current computing technologies allow us to realise what formerly could only be decided by a rough estimate, resulting in a waste of resources due to inaccurate estimates. Computing technologies and simulation software allow for precise estimation of the ac- tion’s outcome without interfering with a real system. Due to the large number of dynamic activities, such as sorting goods in a logistics warehouse, determining the number of person- nel needed to maximise capacity is difficult. As soon as possible, the sorting trucks should depart, and the number of workers should be kept to a minimum. This article contains an algorithm to determine the optimal number of workers in a sorting warehouse with the results of its application. The programme Tecnomatix Plant Simulation and the function of genetic algorithms were used in the implemented example to predict the number of employees. We were able to cut the number of employees by 52.38% while preserving the trucks’ departure time thanks to this algorithm’s assistance. Costs were reduced from EUR 727.70 to EUR 451.00. It was feasible to avoid the waste of labour resources by using simu- lation, and the time required to determine the ideal solution was considerably decreased by employing genetic experiments, which required just 320 experiments instead of 10,000 to find a solution. The study, according to the authors, demonstrates the efficacy of genetic algorithms and the legality of their application in logistics organisations. GAs may not only be a subject for academic debate, but they can also help solve real-world challenges in industry. The spread of computer technology and simulation tools lays the groundwork for an increasing number of businesses to adopt genetic algorithms.

Author Contributions: Conceptualization, P.G. and A.G.; methodology, M.K.; software, Š.M.; val- idation, N.B. and R.S.; formal analysis, W.D.; investigation, L’.D.; resources, P.G.; data curation, Š.M.; writing—original draft preparation, P.G.; writing—review and editing, A.G.; visualization, B.F.; supervision, D.P. All authors have read and agreed to the published version of the manuscript. Funding: Scientific Grant Agency of the Ministry of Education, Science, Research and Sport of the Slovak Republic VEGA grant number [No 1/0225/21]. Institutional Review Board Statement: Not applicable. Informed Consent Statement: Not applicable. Data Availability Statement: The data presented in this study are available on request from the corresponding author. The full text of data is not publicly available due to company privacy. Conflicts of Interest: The authors declare no conflict of interest.

References 1. Milan, G.; Hodon, R.; Binasova, V.; Dulina, L.; Gaso, M. Design of simulation-emulation logistics system. MM Sci. J. 2018, 2018, 2498–2502. [CrossRef] 2. Plinta, D.; Dulina, L. Ergonomics analysis in the context of a digital factory. In Proceedings of the 38th International Conference on Information Systems Architecture and Technology, ISAT 2017, Szklarska Poreba, Poland, 17–19 September 2017; Volume 657, pp. 304–313. [CrossRef] 3. Gola, A. Design and Management of Manufacturing Systems. Appl. Sci. 2021, 11, 2216. [CrossRef] 4. Yadavalli, V.S.; Balcou, C. A supply chain management model to optimise the sorting capability of a ‘third party logistics’ distribution centre. S. Afr. J. Bus. Manag. 2017, 48, 77–84. [CrossRef] 5. Jankowska, D.; Mikušová, M.; Wacowska-Sl˛ezak,J.´ Mobility Issues in Selected Regions of Poland and Slovakia—Outcomes of International Project SOL (Save Our Lives) Survey. Period. Polytech. Transp. Eng. 2014, 43.[CrossRef] 6. Danilczuk, W.; Gola, A. Computer aided material demand planning using ERP systems and Business Intelligence Technology. Appl. Comput. Sci. 2020, 16, 42–55. [CrossRef] 7. Mikusova, M.; Abdunazarov, J.; Zukowska, J. Modelling of the Movement of Designed Vehicles on Parking Space for Designing Parking. In Development of Transport by Telematics; Mikulski, J., Ed.; Springer International Publishing Ag: Cham, Switzerland, 2019; Volume 1049, pp. 188–201. [CrossRef] Processes 2021, 9, 1197 12 of 13

8. Kliment, M.; Trebuna, P.; Pekarcikova, M.; Straka, M.; Trojan, J.; Duda, R. Production Efficiency Evaluation and Products’ Quality Improvement Using Simulation. Int. J. Simul. Model. 2020, 19, 470–481. [CrossRef] 9. Gola, A.; Pastuszak, Z.; Relich, M.; Sobaszek, Ł.; Szwarc, E. Scalability analysis of selected structures of a reconfigurable manufacturing system taking into account a reduction in machine tools reliability. Ekspolatacja Niezawodn. Maint. Reliab. 2021, 23, 242–252. [CrossRef] 10. Górnicka, D.; Kocha´nska,J.; Burduk, A. Production Resources Utilization Improvement with the Use of Simulation Modelling. Adv. Intell. Syst. Comput. 2019, 1051, 41–50. [CrossRef] 11. Ristvej, J.; Ondrejka, R.; Simak, L.; Lovecek, T.; Holla, K.; Lacinak, M.; Surinova, L.; Janosikova, M. Simulation Technologies in Risk Prevention within Crisis Management. In Proceedings of the Modelling and Simulation 2016—European Simulation and Modelling Conference, Las Palmas, Spain, 26–28 October 2016; pp. 327–330. 12. Zagorecki, A.; Ristvej, J.; Comfort, L.K.; Lovecek, T. Executive dashboard systems for emergency management. Komunikacie 2012, 14, 82–89. 13. Bubeník, P.; Horák, F. Proactive Approach to Manufacturing Planning. Qual. Innov. Prosper. 2014, 18, 23–32. [CrossRef] 14. Edl, M.; Votava, V.; Ulrych, Z.; Korecký, M.; Trkovský, V. Analysis and Optimisation of Complex Small-Lot Production in New Manufacturing Facilities Based on Discrete Simulation. In Proceedings of the 20th European Modeling & Simulation Symposium, Amantea, Italy, 17–19 September 2008; pp. 198–203. 15. Sobrino, D.R.D.; Košt’ál, P.; Cagáˇnová, D.; Cambˇ ál, M. On the Possibilities of Intelligence Implementation in Manufacturing: The Role of Simulation. Appl. Mech. Mater. 2013, 309, 96–104. [CrossRef] 16. Saha, S.; Vasegaard, A.; Nielsen, I.; Hapka, A.; Budzisz, H. UAVs Path Planning under a Bi-Objective Optimization Framework for Smart Cities. Electronics 2021, 10, 1193. [CrossRef] 17. Buˇcková, M.; Skokan, R.; Fusko, M.; Hodoˇn,R. Designing of logistics systems with using of computer simulation and emulation. Transp. Res. Procedia 2019, 40, 978–985. [CrossRef] 18. Pekarcikova, M.; Trebuna, P.; Kliment, M.; Rosocha, L. Material Flow Optimization through E-Kanban System Simulation. Int. J. Simul. Model. 2020, 19, 243–254. [CrossRef] 19. Moˇcilan,M.; Žmindák, M.; Pecháˇc,P.; Weis, P. CFD Simulation of Hydraulic Tank. Procedia Eng. 2017, 192, 609–614. [CrossRef] 20. Sobaszek, Ł.; Gola, A.; Kozłowski, E. Application of survival function in robust scheduling of production jobs. In Proceedings of the 2017 Federated Conference on Computer Science and Information Systems (FEDCSIS), Prague, Czech Republic, 4–7 September 2017; Ganzha, M., Maciaszek, M., Paprzycki, M., Eds.; IEEE: New York, NY, USA, 2017; pp. 575–578. [CrossRef] 21. Dulina, L.; Bartanusova, M. CAVE Design Using in Digital Factory. Procedia Eng. 2015, 100, 291–298. [CrossRef] 22. Durica, L.; Micieta, B.; Bubeník, P.; Binasova, V. Manufacturing multi-agent system with bio-inspired techniques: Codesa-prime. MM Sci. J. 2015, 2015, 829–837. [CrossRef] 23. Tao, J.; Zhang, R.; Zhu, Y. DNA Computing Based Genetic Algorithm: Applications in Industrial Process Modeling and Control; Springer: Singapore, 2020. [CrossRef] 24. Tabassum, M.; Mathew, K. A genetic algorithm analysis towards optimization solutions. Int. J. Digit. Inf. Wirel. Commun. 2014, 4, 124–142. [CrossRef] 25. Ayala, H.V.H.; Coelho, L.D.S. Tuning of PID controller based on a multiobjective genetic algorithm applied to a robotic manipulator. Expert Syst. Appl. 2012, 39, 8968–8974. [CrossRef] 26. Lopez, J. Optimisation with Matlab Using the Genetic Algorithm. Multiobjective Optimisation; Amazon Digital Services LLC—Kdp Print US: Seattle, WA, USA, 2019. 27. Zou, T.; Wu, S.; Zhang, R. Improved state space model predictive fault-tolerant control for injection molding batch processes with partial actuator faults using GA optimization. ISA Trans. 2018, 73, 147–153. [CrossRef] 28. Krajˇcoviˇc,M.; Hanˇcinský, V.; Dulina, L.; Grznár, P.; Gašo, M.; Vaculík, J. Parameter Setting for a Genetic Algorithm Layout Planner as a Toll of Sustainable Manufacturing. Sustainability 2019, 11, 2083. [CrossRef] 29. Zhang, C.; Yang, J. Genetic Algorithm for Materialized View Selection in Data Warehouse Environments. In Data Warehousing and Knowledge Discovery; Mohania, M., Tjoa, A.M., Eds.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 1999; pp. 116–125. [CrossRef] 30. Yao, M.; Chu, W. A genetic algorithm for determining optimal replenishment cycles to minimize maximum warehouse space requirements. Omega 2008, 36, 619–631. [CrossRef] 31. Yang, W.; Chan, F.T.; Kumar, V. Optimizing replenishment polices using Genetic Algorithm for single-warehouse multi-retailer system. Expert Syst. Appl. 2012, 39, 3081–3086. [CrossRef] 32. Qin, G.; Li, J.; Jiang, N.; Li, Q.; Wang, L. Warehouse Optimization Model Based on Genetic Algorithm. Math. Probl. Eng. 2013, 2013, 1–6. [CrossRef] 33. Haijun, Z.; Bingwu, L. A New Genetic Algorithm for Order-Picking of Irregular Warehouse. In Proceedings of the 2009 International Conference on Environmental Science and Information Application Technology, Wuhan, China, 4–5 July 2009; Volume 1, pp. 121–124. [CrossRef] 34. Liu, Y.; Ji, S.; Su, Z.; Guo, D. Multi-objective AGV scheduling in an automatic sorting system of an unmanned (intelligent) warehouse by using two adaptive genetic algorithms and a multi-adaptive genetic algorithm. PLoS ONE 2019, 14, e0226161. [CrossRef][PubMed] Processes 2021, 9, 1197 13 of 13

35. Mallawaarachchi, V. Introduction to Genetic Algorithms Code. Available online: https://towardsdatascience.com/introduction- to-genetic-algorithms-including-example-code-e396e98d8bf3 (accessed on 29 May 2021). 36. Tecnomatix Plant Simulation Help. Available online: https://docs.plm.automation.siemens.com/content/plant_sim_help/ 15/plant_sim_all_in_one_html/en_US/tecnomatix_plant_simulation_help/tecnomatix_plant_simulation/tecnomatix_plant_ simulation_help.html (accessed on 10 March 2021).