## 4 Design of Fuzzy Adaptive Genetic Algorithm
### Algorithm Principle  
In this paper, an improved fuzzy adaptive genetic algorithm (FAGA) is proposed. The genetic algorithm based on fuzzy logic makes full use of the existing knowledge and experience of GA and revises and perfects the experience. It is helpful to understand the relationship between GA genetic operators and parameter setting and GA performance. At the same time, in the process of GA operation, the dynamic adjustment of GA parameters or operators is realized, which ensures the reasonable utilization and exploratory relationship EER in the whole GA search process. By writing the rules, changing \(P_{c}\) and \(P_{m}\) into the fuzzy system, and inserting them into the genetic algorithm as a mechanism to adjust the two operators, we can adjust the parameters online in real time and optimize the performance of the algorithm. The algorithm uses the variance of population and individual fitness values to measure the overall population diversity and individual differences, applies it to design a fuzzy reference system that adaptively adjusts \(P_{c}\) and \(P_{m}\), and automatically adjusts the parameters of the genetic algorithm. Fuzzy logic can effectively solve nonlinear problems with language and has fully proved its wide potential in the application of industrial automation. The basic principle of the FAGA algorithm is shown in Figure 2.  
Figure 2: FAGA basic schematic diagram.  
The fuzzy controller obtains the performance measurement and the parameters of \(P_{c}\) and \(P_{m}\) from the genetic algorithm and outputs the adjusted parameters to the optimization algorithm through fuzzy rule processing to achieve the purpose of an adaptive online adjustment algorithm. The optimization simulation results show that, compared with the standard genetic algorithm, the improved algorithm has faster convergence speed, better solution quality, and higher efficiency. The flow chart of the FAGA algorithm is shown in Figure 3.  
The quantity that reflects the individual density in the population generally refers to the variance of the population adaptation value. In the process of evolution, the greater the variance, the more dispersed the spatial distribution of the population, and the lower the crossover probability and mutation probability, so that the population is rapidly concentrated; the smaller the variance, the smaller the mutation probability, and the crossover probability can be increased to avoid prematurity and improve diversity. Therefore, the variance of population fitness can be used to comprehensively express the concentration of the population. At the same time, the parameters of different individuals in each generation should be adjusted differently in each generation.  
Figure 3: FAGA Basic flow chart.  
In this paper, an adaptive genetic algorithm based on fuzzy rules is proposed, in which the fuzzy inference system based on Mamdani changes \(P_{c}\) and \(P_{m}\) to improve the population diversity of the algorithm. The calculation results show that this method has better performance than the general genetic algorithm. This is because it always adjusts the genetic operator to find the global optimal solution without reducing the population diversity, and the quality of the optimized solution is such that it is able to avoid falling into the local optimization.  
The specific operation is as follows: the density of the population is measured by the variance of the distance between all individuals in the population and normalized as the input of the fuzzy system, the fuzzy language is transformed into the corresponding fuzzy variables of \(P_{c}\) and \(P_{m}\), and the \(P_{c}\) and \(P_{m}\) in the algorithm are modified in defuzzification.