## 2 Material and Methods
### The Optimization Model  
The solution procedure of the applied model was based on a genetic algorithm that integrated mutations throughout the various iteration processes and through the action of a tournament selection operator. Figure 2 shows the flow chart for the execution of a typical genetic algorithm. First, the type of variables and their coding for the problem in question should be defined. Then, the fitness function should be stipulated, and it often corresponds simply to the objective function to be optimized. In general, the fitness function can be any function that assigns a merit value relative to an individual. Genetic operators, such as crossover and mutation, are applied stochastically at each stage of the evolution process, so their probabilities of occurrence must be defined. Finally, convergence criteria should be provided [26]. Figure 2: GA implementation flow chart [26]. The algorithm begins by defining the problem and its objective function, f(X), where X is a multidimensional vector of typical dimension d. The initial population is chosen randomly in the search space, and the members are encoded as a chromosome in the form of a string of alphabets. The operations of selection, crossover, and mutation are cyclically applied to the population until the termination criterion is achieved or the maximum number of iterations is reached. At the end of each iteration, the fitness values of the population of strings are calculated. The strings with higher fitness are selected for mating and reproduction. Finally, the string with the highest fitness value is considered the optimum solution to the problem. The pseudocode for the genetic algorithm (Algorithm 1) is illustrated as follows [27]. ```
Initialization:  1. Select initial population of size \(N\)  2. Define objective function f(X)  3. Encode the population as chromosomes (bit strings) of length \(L_{C}\)  4. Compute fitness values of the entire population  5. Define termination condition, if any  6. Choose maximum number of iterations MaxIter  7. iter = 1  8. while (iter \(\leq\) MaxIter) Selection:  9. Select parents for reproduction Crossover:  10. Apply crossover on parents to produce offspring Mutation:  11. Apply mutation on selected chromosomes  12. Compute the fitness values of the population  13. Select members for the next generation based on fitness values  14. If termination condition met exit, else continue  15. iter = iter + 1  16. end while
```  
**Algorithm 1**The pseudocode for the genetic  
Thus, the model aims to enable the optimization of the layout of a productive area through spatial reorganization, considering the distances between the various areas in the layout represented by Euclidean space (abstract mathematical space) based on the minimization of costs [28], according to two distinct approaches, considering:  
* The costs in terms of general risks, which were based on the William T. Fine semi-quantitative assessment method, being applied by determining the values of the average danger level for each area, which was based on the risks and respective risk danger levels in the work carried out by Eurisko, Anaya-Aguilar, Youakim, and Checchi [2; 3; 4; 5]. The calculation of the values related to the average risk level was made using Equation (1):  
\[RL=C\times E\times P \tag{1}\]  
where \(RL\) corresponds to the risk level, \(C\) to the expected consequences, \(E\) to the time of exposure of the worker to the risk situation, and \(P\) to the probability of occurrence. The risks and degrees of danger can then be classified into five levels: Acceptable, Moderate, Remarkable, High, and Very High (severe and imminent). * The costs in terms of ergonomic risks based on the assessment of ergonomic risks related to the expenditure of metabolic energy that occurs during the execution of the various tasks within each work area. It is noteworthy that an estimation of metabolic energy values was made based on the comparison with several tasks already studied by Ainsworth et al.