## 2 Materials and Methods
### Elimination of Invalid Configurations in the Solution Space
```
Inputs: fixed_panel_array, adaptive_panel_array, numChromosomes, crossoverRate, mutationRate Output: optimum_configuration, bestchromosome, bestfitness (max-min: CVI)
1:\(N\)\(\leftarrow\)length(adaptive_panel_array) // A
2:\(ROW\)\(\leftarrow\)length(_panel_array) // A
3:\(K\)\(\leftarrow\)length(_panel_array) // F
4:chromosome\(\leftarrow\)N*\(ROW\)
5:population\(\leftarrow\)initial_population_generate()
6:Threshold\(\leftarrow\)value_between_0_and_1, bestfitness\(\leftarrow\)value_between_0_and_1
7:loop bestfitness\(>\)threshold // Fitness values are calculated and stored in the fitnessValues array
7:fitnessValues\(\leftarrow\)empty_array
8:loop\(i\) = 1 to length(population)
9:chromosome\(\leftarrow\)population(\(i\))
10:fitnessValues\(\leftarrow\)fitnessValues\(+\)fitness_function(chromosome, \(N\), \(ROW\), \(A\), \(F\))
11:endloop
12:bestindex\(\leftarrow\)argminfitnessValues\([k]\) // Selection of the best chromosome
13:bestfitness\(\leftarrow\)fitnessValues[bestindex]
```

**Algorithm 5**_Genetic Algorithm-Based Controller_

Metaheuristic algorithms are general-purpose solution search techniques that aim to find optimum or approximate solutions in complex and large solution spaces. These algorithms are more flexible than traditional heuristic approaches and can be applied to different types of problems instead of adhering to rigid rules developed for a problem. Metaheuristic algorithms generally prevent local minima or maxima in global optimization problems and aim to reach the best solution by exploring large solution spaces. Inspired by natural events, biological processes, social dynamics and physical processes, these algorithms use evolutionary processes, swarm behaviors or random search methods. The problem discussed in this article is an optimization aimed at finding the most appropriate solution in a very large solution space that falls into the category of high-dimensional discrete optimization. The solution space consists of thousands or even millions of bit sequences, each of which has a fixed length such as 32 bits or 256 bits. This problem can be directly defined as a global optimization problem. Global optimization problems require searching over the entire solution space, and since they usually have a very large and complex structure, traditional algorithms are inadequate in solving```
14:bestChromosome-population(_bestindex_) // Creating a new population
15: create newPopulation // A population with zero values is created // Selection process
16:for1 tonumChromosome
17: SET valid 0
18:whilevalid \(\
eq\) 1
19:parent1 index\(\leftarrow\)random_chromosome_number_generate
20:parent2 index\(\leftarrow\)random_chromosome_number_generate
21:parent1\(\leftarrow\)population[parent1 index // Two chromosomes are randomly selected
22:parent2\(\leftarrow\)population[parent2 index] // caprazlama
23:ifrandom_value<_crossoverRate
24:child\(\leftarrow\)parent1
25:crossoverPoint\(\leftarrow\)random(chromosome_length_-1)
26:select_crossover_segment from child // from crossoverPoint to childend
27:select_crossover_segment from parent2 // from crossoverPoint to parent2 end
28:child_crossover_segment\(\leftarrow\)parent2_crossover_segment
29:else
30:child\(\leftarrow\)parent1
31:endif // mutation process
32:loop\(j=1\) tochromosome_Length
33:ifrandom_value < mutationRate
34:child(\(j\))\(\leftarrow\)1-child(\(j\))
35:endif
36:endloop // verifying configuration validity
37:valid\(\leftarrow\)valid_configuration(_child_, \(N\), \(ROW\))
38:endwhile
39:newPopulation(\(i\))\(\leftarrow\)child
40:endfor // Setting the validated new population for use
41:population = newPopulation
42:endloop
```  
**Algorithm 2**_Cont. Algorithm 2 aims to determine the optimal configuration that minimizes the CVI value, thereby maximizing efficiency. To achieve this, the best chromosome optimized through the fitness function is selected. This chromosome represents the connection configuration between fixed and adaptive panels that maximizes energy efficiency.