3. Experiment Results and Analysis
To verify the effectiveness of the MPSO algorithm, six benchmark functions listed in
Table 1 were used to evaluate the performance, such as the time consumption and precision of Algorithm 1 in our experiment. In addition, the influence of different communication methods and microenvironment network topologies on the performance of Algorithm 1 is tested.
Figure 2 shows the shapes of those six benchmark functions when the number of independent variables
d is 2. In the experiment for Algorithm 1 executed in each microenvironment,
n=20,
d=2,
c1=2,
c2=2,
ω=0.8, where
n is the local particle number,
d is the dimension of the particle position,
c1 and
c2 are learning factors, and
ω is the inertia factor. The fitness function
fun (), the maximum number of iterations maxN, and the neighbor microenvironment node list pNeighbor were determined based on the optimization problem, the iteration termination condition, and the topology of the microenvironment network.
The topology of the microenvironment network used in the experiment is shown in
Figure 3, which corresponds to the distribution of spatial units of the Anhui Province Key Laboratory of Intelligent Building and Building Energy Saving [
40]. When an optimization problem is solved using the PSO algorithm, the solution obtained by a single run of the PSO algorithm is typically a candidate solution of the optimization problem since PSO is a stochastic search algorithm. To find the optimal solution to an optimization problem, the PSO algorithm must be applied multiple times, and the candidate solution with the best precision is chosen as the optimal solution. Because there are 12 microenvironments in the microenvironment network illustrated in
Figure 3, the experiment first treated these 12 microenvironments as 12 independent computing environments in which the PSO algorithm independently solved the extremum of benchmark functions when the PSO algorithm is used to independently solve the extremum of benchmark functions in each computing environment,
n=240,
d=2,
c1=2,
c2=2, and
ω=0.8.
The time consumed and convergence precision of the PSO algorithm in the 12 nodes microenvironment network shown in
Figure 2 when maxN=200 for the extremum of each benchmark function solving are listed in
Table 2. According to
Table 2, when the PSO algorithm is repeatedly used to solve the extremum of the benchmark functions, the performance of the extremum candidate values for all benchmark functions, except the Schwefel function, exceeds the desired performance of 1e-05, and the extremum performance of the Schwefel function can reach the 1e-05 level. Additionally, the significant differences between the values in the “maximum” and “average” of precision columns shaded in gray and the corresponding “minimum” values of precision in
Table 2 indicate the necessity of running the PSO algorithm multiple times for optimization problem solving. Similarly,
Table 3 lists the time, convergence precision, and maximum number of iterations for independently solving the extremum of each benchmark function using the PSO algorithm in 12 microenvironments with maxN=200 and goal precision=1e-5.
Table 4 lists the time and convergence precision for independently solving the extremum of each benchmark function using the PSO algorithm in 12 microenvironments with goal precision=1e-5 and maxN=20,000 to prevent excessively long computation times.
Given that the experimental data in
Table 2 show that the performance of the PSO algorithm for the extremum of the Schwefel function solving is greater than 1e-5, the goal performance for the minimum value of the Schwefel function in
Table 3 is 1e-04. For comparison, the goal performance for the minimum value of the Schwefel function in
Table 4 is 1e-5.
Table 3 and
Table 4 show that when the PSO algorithm is repeatedly used to solve the extremum of the benchmark functions, the performance of the minimum value of all benchmark functions, excluding the Schwefel function, surpasses 1e-5, which is the goal performance. In contrast, the performance of the Schwefel function’s minimum value surpasses 1e-4. According to the minimum precision in
Table 2,
Table 3 and
Table 4, it can be concluded that the PSO algorithm can effectively obtain the extremum of all benchmark functions. Furthermore, the significant differences between the shaded “maximum” and “average” values of precision and the corresponding “minimum” values of precision in
Table 2,
Table 3 and
Table 4 also highlight the necessity of running the PSO algorithm multiple times.
By comparing the data in the “Minimum” column of the precision part and the “Minimum,” “Maximum,” “Average,” and “Total” columns of the time part for the Schwefel row in
Table 2,
Table 3 and
Table 4, respectively, it can be observed that when the minimum of the Schwefel function is solved using the PSO algorithm, as shown in the data in
Table 2 and
Table 3, the performance of the feasible solutions obtained by the PSO algorithm can quickly surpass 1e-4. However, by comparing the data in
Table 4, even with continued iterations, the precision of the feasible solutions obtained by the PSO algorithm remained challenging, reaching 1e-5 within 20,000 iterations.
With the microenvironment network of 12 microenvironment nodes illustrated in
Figure 3, the experiment further tested the time and precision performance of the synchronous MPSO algorithm for the extremum search of each benchmark function. The experimental results for maxN=200 are presented in
Table 5.
Table 6 presents the experimental results for maxN=200 and 1e-05 as the goal precision, where maxN is the maximum number of iterations.
Table 7 lists the experimental results for 1e-05 as the goal precision. In
Table 6 and
Table 7, the goal precision for the minimum Schwefel function is 1e-04. In the experiment, the number of particles in the PSO algorithm was set to 240 with 20 particles in each microenvironment. Based on the minimum precision values listed in
Table 5,
Table 6 and
Table 7, it can be concluded that the synchronous MPSO algorithm can effectively determine the extremum of all benchmark functions. Furthermore, by comparing the summary of the time part in
Table 2,
Table 3 and
Table 4 with the maximum time part in
Table 5,
Table 6 and
Table 7, it is evident that when an optimization problem must be solved multiple times under the same convergence conditions to obtain some candidate solutions, and the optimal solution for the desired optimization problem is selected from those multiple candidates, the synchronous MPSO algorithm consistently requires much less time than the PSO algorithm.
Using the microenvironment network of the 12 nodes microenvironment illustrated in
Figure 3, the experiment further tested the time and precision performance of the asynchronous MPSO algorithm for the extremum of each benchmark function. The experimental results for maxN=200 are presented in
Table 8.
Table 9 presents the experimental results for maxN=200 and 1e-05 as the goal precision, where maxN is the maximum number of iterations.
Table 10 lists the experimental results for 1e-05 as the goal precision. In
Table 8 and
Table 9, the goal precision for the minimum Schwefel function is 1e-04. In the experiment, the number of particles in the PSO algorithm was set to 240 with 20 particles in each microenvironment. Based on the minimum precision values listed in
Table 8,
Table 9 and
Table 10, it can be concluded that the asynchronous MPSO algorithm can effectively determine the extremum of all benchmark functions. Furthermore, by comparing the summary of the time part in
Table 2,
Table 3 and
Table 4 with the maximum time part in
Table 8,
Table 9 and
Table 10, it is evident that when an optimization problem must be solved multiple times under the same convergence conditions to obtain some candidate solutions, and the optimal solution for the desired optimization problem is selected from those multiple candidates, the asynchronous MPSO algorithm consistently requires much less time than the PSO algorithm. By comparing the precision and time data in
Table 5,
Table 6 and
Table 7 and
Table 8,
Table 9 and
Table 10, it can be observed that the asynchronous MPSO algorithm generally achieves slightly lower precision in approximating the optimal solutions of all benchmark functions compared to the synchronous MPSO algorithm, but it requires more time. The synchronous MPSO algorithm performed better than the asynchronous MPSO algorithm in solving the optimal solutions of the benchmark functions.
The topology of the microenvironment network for the performance data of the MPSO listed in
Table 5,
Table 6,
Table 7,
Table 8,
Table 9 and
Table 10 is illustrated in
Figure 3, which is an actual microenvironment network deployed in the Anhui Provincial Key Laboratory of Intelligent Buildings and Building Energy Saving. It is consistent with the spatial unit distribution of the laboratory. Furthermore, to test the robustness of the MPSO algorithm, four different microenvironmental network topologies were used, and the microenvironment network had 12 microenvironment nodes. The topologies of the four microenvironmental networks are shown in
Figure 4. These topologies were used to evaluate the performance of the synchronous MPSO algorithm in solving the extremum of all benchmark functions. The goal performance for the Schwefel function was set to 1e-04, whereas that for the other benchmark functions was set to 1e-05.
Four microenvironment networks are shown in
Figure 4. Each microenvironment network shown in
Figure 4 has 12 microenvironment nodes, each of which has a unique topology, such as line, ring, full, or random topology. In the line microenvironment network, except for the first and last nodes, each node has two neighbors, and each node can only communicate with its adjacent neighbors. In a ring microenvironment network, each node has two neighboring nodes, and all nodes form a closed loop. Each microenvironment node can communicate with its neighbors only in a ring microenvironment network. In a full microenvironment network, each microenvironment node can communicate with each other nodes. The random topology of a microenvironment network is a randomly generated connected graph with 12 nodes. When generating a random topology, each node must have at least one neighbor and no more than six neighbors. This corresponds to the spatial structure of a building, where each spatial unit can have up to six neighbors located in directions such as up, down, left, right, front, and back.
To test the performance of the synchronous MPSO algorithm for the extremum of all benchmark functions solved across the four different microenvironment network topologies, in further experiments, the synchronous MPSO algorithm was executed in each microenvironment, and
n=20,
d=2,
c1=2,
c2=2,
ω=0.8, where
n is the local particle number,
d is the dimension of the particle position,
c1 and
c2 are the learning factors, and
ω is the inertia factor. Furthermore, the goal performance for each benchmark function, except for the Schwefel function, was set to 1e-05, and the goal precision for the Schwefel function was 1e-04. Meanwhile, maxN, the maximum number of iterations, was set to 20,000. The fitness function
fun() was defined as each of the benchmark functions, and the list of neighboring microenvironment nodes pNeighbor was determined based on the microenvironment network topologies shown in
Figure 4.
With those four microenvironment networks illustrated in
Figure 4, the experiment further tested the time and precision performance of the synchronous MPSO algorithm for solving the extremum of each benchmark function. The time and precision data are listed in
Table 11,
Table 12,
Table 13 and
Table 14. The precision of the synchronous MPSO algorithm in solving the extremum of all benchmark functions in each microenvironment network topology can reach this goal. Furthermore, by comparing the Total Time data in the “Total Time” column of
Table 4 with the maximum time data in the “Max Time” column of
Table 11,
Table 12,
Table 13 and
Table 14 to solve the extremum of each benchmark function, it is evident that when the best solution of an optimization problem needs to be selected from some candidate solutions, the time consumed by the synchronous MPSO algorithm is less than the time consumed by the PSO algorithm.
In the current research and application of building intelligence and building energy efficiency, to complete some common tasks, such as fault diagnosis and optimization, fine-grained environmental control, energy efficiency optimization, occupant localization, and occupant behavior analysis, the reconstruction of the temperature field in building spatial units based on temperature monitoring data from a few interesting locations is a common optimization task. The PSO algorithm is frequently employed to optimize the temperature field reconstruction model.
In the following experiment, a feedforward neural network with one hidden layer was used as the reconstruction model of the temperature field for building spatial units. This model had an input layer with two input neurons, a hidden layer with two hidden neurons, and an output layer with one output neuron. The input layer was fully connected to the hidden layer, and the hidden layer was fully connected to the output layer. Each neuron in the hidden and output layers had a bias. The active function for each hidden layer neuron is a hyperbolic tangent function
, and the active function for each output layer neuron is the linear function
. During data collection, only five temperature monitoring points were arranged in the northeast, southeast, southwest, northwest, and center of the building spatial unit. The volume of the collected data was minimal, whereas the spatial span was large. Therefore, it is not advisable to train the feedforward neural network using the BP algorithm directly. Hence, the model parameters (weights of all neuron connections) were trained using the PSO algorithm. The performance of the MPSO algorithm for the temperature field reconstruction model training in the microenvironment topology illustrated in
Figure 3 was tested in the following experiment. For comparison, the performance of the PSO algorithm for training the temperature field reconstruction model was also tested in the following experiment. Information such as computation time, precision, and number of iterations of the PSO, Synchronous MPSO, and Asynchronous MPSO algorithms for the temperature field reconstruction model training are given in
Table 15, and the temperature fields reconstructed by the temperature field reconstruction model trained by the PSO, Synchronous MPSO, and Asynchronous MPSO algorithms are shown in
Figure 5. In the experiment, the goal precision for the PSO, Synchronous MPSO, and Asynchronous MPSO algorithms was set to 1e-08, and the maximum number of iterations (maxN) was set to 2000. The number of particles in the PSO algorithm was 600, whereas the number of particles in each microenvironment for both the synchronous and asynchronous MPSO algorithms was 50. To collect data for the information in
Table 15, the PSO algorithm independently optimized the temperature field reconstruction model in 12 microenvironments. By contrast, the synchronous and asynchronous MPSO algorithms optimized the model in the same 12 microenvironments.
From the data in the “Min” column of the precision part in
Table 15, it can be asserted that the PSO, synchronous MPSO, and asynchronous MPSO algorithms can effectively optimize the temperature field reconstruction model. Moreover, by comparing the data in the “Min,” “Max,” and “mean” columns of the precision part in
Table 15, it is evident that when the PSO algorithm is used to optimize the temperature field reconstruction model, the precision of the model fluctuates significantly upon convergence. In contrast, when the synchronous and asynchronous MPSO algorithms were used to optimize the temperature field reconstruction model, the precision of the model remained stable. The similarity in the contour plots of the temperature fields reconstructed by the models using the three methods, as shown in
Figure 5, also indicates that these algorithms can optimize the temperature field reconstruction model. Furthermore, from the time taken for the optimization of the temperature field reconstruction model in
Table 15, the maximum optimization time for the synchronous and asynchronous MPSO algorithms was significantly less than the total time taken by the PSO algorithm when it was repeated 12 times (the total time was 12 times the average value). The maximum time required by the synchronous MPSO algorithm was also less than that of the asynchronous MPSO algorithm. The synchronous MPSO algorithm is more suitable for optimizing the temperature field reconstruction model.
All experiments were completed on a microenvironment network platform with 12 PCs as microenvironment nodes. Each PC had one Intel Core i7 processor and 16GB of DDR4 memory. A microenvironment network platform was constructed based on the local area network. All PCs were purchased from the same vendor in the same batch to ensure consistent performance metrics. The operating system for each microenvironment was Linux Fedora fc38.x86_64. Each algorithm was implemented using Python programming language. MariaDB 10.5.21 for Linux (x86_64) was deployed to store the local data in each microenvironment.