# Optimization of Glulam Regular Double-Tapered Beams for Agroforestry Constructions
## 2 Materials and Methods
### Optimization by Genetic Algorithms
Equation (19) shows the modified objective function employed in the optimization of the roof structure: \[\text{F(x)}=\text{f(x)}+\sum_{j=1}^{4}\text{Pj(Gj(x))},\] (19) where F(x) is the modified objective function (EUR), x is the individual of the study population, j is the number of variables studied, f(x) is the objective function in terms of cost (i.e., computed as the product of the m\({}^{3}\) of timber at a value of 900 EUR/m\({}^{3}\)), Pj is the penalization term according to the restrictions imposed on each of the elements, and Gj(x) is the penalty parameter of the imposed restrictions with the same order of magnitude as the objective function and defined according to the maximum utilization ratio noticed in each structural element for j taking values ranging from 1 to 4: \(\bullet\) G1(x) is the highest ultimate limit state utilization ratio of the beam: \(0>\text{G1(x)}>1\) then, P1(G1(x)) = 300 \(\times\) 10\({}^{\text{(1-G1(x))}}\); G1(x) = 1 then P1(G1(x)) = 0; G1(x) = 0 then P1(G1(x)) = 4000; G1(x) > 1 then P1(G1(x)) = G1(x) \(\times\) 40,000. \(\bullet\) G2(x) is the highest serviceability limit state utilization ratio of the beam: \(0>\text{G2(x)}<1\) then P2(G2(x)) = 180 \(\times\) 10\({}^{\text{(1-G2(x))}}\); G2(x) = 1 then P2(G2(x)) = 0; G2(x) = 0 then P2(G2(x)) = 2400; G2(x) > 1 then P2(G2(x)) = 12,000 \(\times\) S(x). \(\bullet\) G3(x) is the highest ultimate limit state utilization ratio of the purlin: \(0>\text{G3(x)}>1\) then P3(G3(x)) = 172.5 \(\times\) 10\({}^{\text{(1-G3(x))}}\); G3(x) = 1 then P3(G3(x)) = 0; G3(x) = 0 then P3(G3(x)) = 4000; G3(x) > 1 then P3(G3(x)) = G3(x) \(\times\) 23,000. \(\bullet\) G4(x) is the highest serviceability limit state utilization ratio of the purlin: \(0>\text{G4(x)}>1\) then P4(G4(x)) = 172.5 \(\times\) 10\({}^{\text{(1-G4(x))}}\); G4(x) = 1 then P4(G4(x)) = 0; G4(x) = 0 then P4(G4(x)) = 230; G4(x) > 1 then P4(G4(x)) = G4(x) \(\times\) 1150. The values used in the penalty function were obtained through a parametric analysis and are similar to those obtained in other works [28; 29]. It should be noted that in other works, such as [PERSON] and [PERSON] [30], the modified objective function is also based on optimizing the timber volume by using penalty functions that depend on the values of stress and strain utilization ratios. However, as the optimization is focused on an isolated beam, the authors resort to reasonably simple functions based on the criteria of the beam's compliance or non-compliance. In [PERSON]'s work [31], beams are also optimized by means of a cost-based objective function (i.e., constructed by multiplying the required volume and the glulam price), but without implementing a modified objective function. 4 Reproduction operators: The algorithm utilizes the following operators to generate new individuals to be evaluated in subsequent generations: * Selection: The fittest individuals are selected as the basis for the next generation. The method used in this optimization is roulette selection, which assigns a proportion of a roulette wheel to each individual in the population based on their adjusted score. The individuals are ordered from lowest to highest score based on their modified objective function, and each is assigned a probability of reproduction inversely proportional to that score, giving the fittest individuals a better chance of reproducing. * Crossover: Suitable individuals are crossed to generate better individuals. This approach allows for traits (i.e., information) to be transmitted among the most suitable candidates. In this paper, a two-point crossover was used in order to select two positions on the parents' chromosome and force the sections to be exchanged. * Elitism: This is employed to accelerate the optimization process. The fittest individuals from the population are kept in the new population using the modified objective function as a criterion. * Mutation: Promotes a degree of alteration of the chromosomes of some individuals to provide certain variability in the population.