## 3 Energy Optimization of Intelligent Building by Using Niche Genetic Algorithm
### Intelligent Building Control System  
Among the control variables of an intelligent building control system, three control parameters, namely new energy, energy delivery temperature, and water supply temperature play a key role in the overall wasting of resources and operation characteristics of the system, while other control variables have little influence on the wasting of resources of the system [35]. Aiming at these three variables, an optimal control objective function is established, and a niche genetic algorithm is used for optimization, so as to obtain the optimal control variable value that minimizes the objective function and realizes the control of the air-conditioning equipment system. The control goal of intelligent building system optimization is to minimize the waste of resources of the system on the premise of ensuring comfort. Comfort can be measured by building thermal comfort and air quality. Therefore, the optimal control objective function of the system is  
\[\mathrm{F}=\int_{0}^{\
abla}\left(\alpha\mathrm{P}+\beta\mathrm{MV}+\gamma \mathrm{Y}\right)\mathrm{dt} \tag{1}\]  
where \(\alpha\), \(\beta\), and \(\gamma\) are the control parameters of new energy, energy delivery temperature, and water supply temperature, respectively. For buildings with different use properties, the values of the three parameters are also different. When the building has higher requirements for new energy and energy delivery temperature, the values of \(\beta\) and \(\gamma\) are greater than 1, and the values of \(\alpha\) are less than 1; when buildings have high requirements for wasting of resources, the value of \(\alpha\) is greater than 1, while the values of \(\beta\) and \(\gamma\) are less than 1. In the same evolutionary environment, the improved niche genetic algorithm is not affected by the population size and evolutionary algebra, and it can obtain the same optimal solution, and its convergence will not change with the increase in evolutionary algebra. Moreover, it takes the shortest time in the whole iterative evolution process, and the average time of each generation in the same iterative evolution is also the shortest. Therefore, the improved niche genetic algorithm has relatively good convergence performance and the lowest running time complexity of the algorithm [36,37]. Its relatively stable convergence is also an optimization of the traditional algorithm, and it is not easily influenced by some excellent individuals, which makes the evolutionary direction move in the opposite direction or in a direction unfavorable to the population evolution, which leads to premature falling into a certain local cycle, thus reducing the diversity of the new generation of individuals, and even the whole population will be quickly covered by a large number of these excellent individuals, resulting in a fast stable state, as shown in Figure 2.  
Compared with the traditional genetic algorithm and differential evolution algorithm, the improved niche genetic algorithm takes the shortest time in the whole evolution process and obtains the optimal solution after iteration. The convergence performance is not reduced by increasing the population size, and the same optimal solution can be obtained after iteration [38]. The evolution algebra of the improved niche genetic algorithm is larger than that of the genetic algorithm when it tends to a stable state, but its convergence performance is improved. From the evolution data, the genetic algorithm quickly enters a stable state in the early stage of evolution, while the difference algorithm is relatively slow, but the final convergence performance is higher than that of the traditional genetic algorithm. on the basis of the traditional algorithm, the improved niche genetic algorithm improves the evolution speed, avoids the limitation of premature local convergence of the genetic algorithm, and the whole running process takes a relatively short time. This Algorithm shows the overall process of the niche genetic algorithm for the energy optimization of intelligent buildings.