# Optimization of Glulam Regular Double-Tapered Beams for Agroforestry Constructions
## 2 Materials and Methods
### Optimization by Genetic Algorithms  
Structural optimization refers to the process of designing a structure in order to optimize its performance. In the scope of this investigation, the objective lies in the best timber roof structure design with respect to a minimum cost while meeting predefined criteria in the structural design standards for strength, stability and rigidity. In this regard, a model based on genetic algorithms was developed to optimize the design. Genetic algorithms are based on the principles of genetics and natural selection, allowing a population of potential designs to evolve over multiple generations. The algorithm evaluates each individual design based on its fitness (i.e., the ability to meet the predefined performance criteria). The fittest individuals are selected for reproduction, and their genetic material is recombined to produce offspring. Those designs are then evaluated using the fitness function, and the fittest individuals are selected to form the next generation. Through successive generations, the algorithm converges on a solution that optimizes the design variables while satisfying the constraints. Figure 3 illustrates the optimization process employed in this research work. As previous studies [8; 9; 28; 29] have described structural optimization using genetic algorithms, this section focuses solely on its adaptation to the present research work. 1. Individuals: They represent the potential solutions to the problem and can be represented as a set of parameters called genes, which together form the chromosomes that encode the values of the design variables. In this case, the individuals are each possible structural solution composed of beams and purlins. The values encoded by the chromosomes are the optimized dimensions of the beams and purlins (Hb, Hp, Wb and Wp), as well as the arrangement of these structural elements (Sp and Sb) in the roof structure. It should be noted that the number of beams (Nb) is also included as a variable in order to take into account the different roof lengths considered in the final part of the study. 2. Population: The set of individuals to be assessed in one generation. For the roof structure optimization, 600 individuals were considered. Figure 3: Optimization process of the roof structure by means of genetic algorithms. 3. Objective function: The objective function serves as the measure of effectiveness for each individual in the optimization process. In this research, fitness was based on minimizing the weight of the structure and, thus, the cost. However, certain individuals did not meet the constraints of the structural calculation rules. Therefore, a modified objective function was necessary to penalize their lack of compliance. To generate valid individuals, the value of the utilization ratio was limited to the unit to meet the restrictions. Additionally, an element that was oversized would be assigned a coefficient much lower than one. Thus, the penalty assigned a greater weight to those elements that did not meet the constraints or were oversized. However, the penalty was kept as low as possible, i.e., above the limit at which infeasible solutions become optimal.