## 3 Solution Methodology
### Population-Based Genetic Algorithm (PGA)  
The PGA is based on the evolutionary process observed in humans, animals, and other living organisms, which involves selection, recombination, and random mutation processes [40]. Unlike the traditional GA, the PGA employs evolution rules based on descendant populations, allowing the entire parent population to be replaced by fitter descendants that contain the best genetic information within their encoding, which accelerates the convergence of the algorithm and improves the quality of its solutions. The solution process for the proposed optimization problem is primarily divided into two stages. First, the PGA must search for the operation scheme that achieves the best impact on the defined objective function. Each individual in the population represents a candidate schedule in terms of active and reactive power injection by the WTs. In the second stage, the impact of each candidate solution is evaluated through an hourly power flow analysis, which calculates the corresponding values of the objective function and the system constraints based on the dispatched active and reactive power of the WTs. These results are then processed by a fitness function, which penalizes the objective function whenever any constraint is violated. This penalization strategy enhances the exploration capability of the optimization method and contributes to reducing the overall processing times [41]. The hourly power flow analysis conducted in this work was based on the SA method, a numerical technique that allows for the efficient load flow analysis of electrical systems with low processing times and excellent convergence performance [42]. Specifically, the method performs 24 load flow calculations, adjusting the generation and demand profiles according to the data for each time period, and it evaluates the corresponding impact on the objective function and system constraints for each hour. With the nodal voltage values obtained from the load flow analysis and the system parameters, it is possible to compute the effect on the objective function for each hour in the analyzed day of operation while considering, through the adaptation function, the penalty value applied when any constraint is violated. After analyzing all 24 h, the effects on the objective function for each hour are summed, which yields the result for one day of MG operation for each individual provided by the PGA. The iterative process used to implement the PGA for efficiently solving the studied optimization problem is as follows:  
* **Step 1. ** The initial population is randomly generated, with active power values ranging from zero (i.e., the minimum power output of the WTs) to the maximum power levels produced by the turbines operating at their maximum power point during an average day of operation. Similarly, the reactive power values to be supplied by the WTs are randomly generated while considering the available capacity of the power converters. Each individual in the population is encoded, as illustrated in Figure 5.
* **Step 2. ** The fitness function values of each individual in the population are evaluated via an hourly power flow analysis based on the SA method, which will be described later in this section. This evaluation depends on the selected objective function, which, in this case, may involve minimizing operating costs, energy losses, or \(CO_{2}\) emissions, as applicable. * **Step 3. ** After evaluating all individuals in the population, the best solution is stored as the incumbent for the optimization problem. * **Step 4. ** Through selection, recombination, and mutation processes, a new offspring population is generated in each iteration. During the selection process, four parents are randomly chosen from the population. These parents compete against each other to identify the two fittest candidates for recombination. Recombination generates offspring by averaging the information contained within the parents, which is possible thanks to the continuous nature of the optimization problem.