## 4 Simulation Examples and Results
### Results  
The results obtained for the different combinations of mutation and crossover probabilities obtained for the proposed reference case are summarized in Table 3. It can be observed that the best individual has been obtained using 0.7 and 0.3 for the crossover (\(p_{cx}\)) and mutation (\(p_{mut}\)) probabilities, respectively. The execution of the algorithm exhibited good convergence after approx. 500 generations for almost all trials, with slight improvements during the next hundred generations. In Figure 12, the best fitness of each generation has been represented by one of the trials of the cited probability values. \begin{table}
\begin{tabular}{c c} \hline
**Parameter** & **Value** \\ \hline \(\lambda\) & 2000 \\ \(\mu\) & 2000 \\ Generations & 100 \\ Selection & Tournament size = 3 \\ Generation & Custom generation scheme \(\sigma=4.20\) \\ Crossover & Custom crossover scheme \\  & \(\phi=0.50\) \\ Mutation & Custom mutation scheme \\  & \(p_{mut,mov}=0.01\) \\  & \(p_{mut,01}=0.05\) \\  & \(p_{mut,10}=0.20\) \\  & \(p_{cx}=[0.2,0.3,0.4,0.5,0.6,0.7]\) \\  & \(\mu_{cx}=[0.20.40.50.60.8]\) \\ Number of trials & 10 \\ Diameter range (m) & 0.01–0.33 \\ \hline \end{tabular}
\end{table} 
Table 2: Parameters of the Genetic Algorithm. Figure 11: Influence of the scale parameter \(\sigma\) on the average fitness of the generated populations. Each dot represents the average fitness of a population of 10,000 individuals. This individual represents a plant layout with a total cost of 20,966.11 (c.u. ), significantly better than the one obtained by other configurations. The solution provides enough power for the electrical demand required (power generation is slightly superior to the 7 kW required) and satisfies the curvature constraint. It can also be seen how the minimal bending radius depends on the diameter of the pipe, according to Equation (12). Observing the layout that corresponds to this solution (see Figure 13), it can be seen how the pensetock, with a 14 cm diameter, cuts through rough terrain and avoids local curvatures of the river. Figure 12: Evolution of the best fitness obtained through generations for the best case evaluated (\(p_{mut}=0.30\), \(p_{cx}=0.70\)). \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & \multicolumn{5}{c}{**Hyper-parameters**} \\ \hline \(p_{mut}\) & 0.70 & 0.60 & 0.50 & 0.40 & 0.30 \\ \(p_{cx}\) & 0.30 & 0.40 & 0.50 & 0.60 & 0.70 \\ \hline \multicolumn{5}{c}{**Final population fitness**} \\ \hline Mean & 22,066.77 & 23,031.35 & 23,397.92 & 22,551.43 & 22,133.37 \\ Std. dev. & 991.25 & 876.34 & 345.59 & 583.70 & 828.1163 \\ Min & 21,193.04 & 21,836.64 & 23,216.90 & 21,787.5 & 20,966.11 \\ Max & 41,083.82 & 48,206.39 & 41,396.83 & 33,011.61 & 25,811.00 \\ \hline \multicolumn{5}{c}{**Best individual**} \\ \hline Gross h. (m) & 80.74 & 84.04 & 86.98 & 82.40 & 79.98 \\ Power (W) & 7017.69 & 7000.24 & 7009.17 & 7000.49 & 7003.06 \\ Pens. length (m) & 534.56 & 562.24 & 597.30 & 552.59 & 532.42 \\ Min, bending & 80.00 & 67.36 & 60.00 & 58.07 & 58.99 \\ Ending & & & & & \\ radius & 54.23 & 53.08 & 52.50 & 53.67 & 54.55 \\ allowed (m) & & & & & \\ Pipe diam. (m) & 0.14 & 0.13 & 0.13 & 0.13 & 0.14 \\ Cost (c.u.) & 21,193.04 & 1836.64 & 23,216.90 & 21,787.50 & **20,966.11** \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Summary of the last population and best individuals obtained. Lower cost has been highlighted in bold. Once the optimal hyper-parameters have been determined, these have been used to solve the modified versions of the reference case. The best solutions obtained are represented in Figure 14, and the main variables associated with these are summarized in Table 4, together with the reference ones. A few interesting comments can be made after observing these results. With respect to the first modification of the problem, it can be seen that, as the required penstock length is smaller, the layout can be drawn with a much smaller curvature (the minimum bending radius is more than twice the minimum allowed).