# Multi-Agent Dynamic Fog Service Placement Approach
## 5 Results  
A few types of experiments were performed to test the performance of the method that was presented in the publications [54; 55]. Choosing the right coefficients such as an inertia weight means an optimal balance between the lowest number of global optimum failures and the shortest possible execution duration. A criteria number in its turn defines the range of a matrix for a pairwise comparison. A few criteria may initially be enough,  
Figure 12: GlobalTimer class. but the number may increase as the system complexity increases. Stress tests are meant to take into account the availability of resources, which may vary due to some background processes. A security package and its services trigger additional calculations. Therefore, it may or may not have a significant impact on the response time. And finally, due to the mobile nature of fog devices and their limited energy resources, power consumption is considered and tested. For the IMOPSO algorithm to function as optimally as it is possible, it is necessary to consider such coefficients as inertia, cognitive, and social. Inertia weight was first introduced in [62]. The purpose of the inertia weight \(w\) is to balance between the local search and the global search. Please see Figure 13 for more details. As a default setting, 4 simulated fog nodes, 12 services, and 200 epochs were used. Particles ranged from 50 to 500. The range of the inertia weight was 0.3 to 1.3. The cognitive and social coefficient was 1.499, which had a slight adjustment to the value of 1.496180. As per publication [63], it leads to convergent behavior. As is visible from the test results, the inertia weight coefficient 0.6 demonstrated the best outcome in finding a global optimum. It can be considered as a threshold value, which will be used in further experiments. Different fog nodes might have different technical characteristics since heterogeneity is a part of fog computing. They also might have constrained resources and different QoS requirements. We use a judgement AHP matrix to evaluate such a situation and to prioritize different criteria. All the experiments are mainly completed using a four-criteria matrix. It includes power, CPU, security, and RAM. Power primarily, in our experiments, is expressively prioritized over other criteria. There is no particular reason for this, and any criteria can be adjusted as required. \[Q= \begin{bmatrix}1&7&7&7\\ 1/7&1&2&2\\ 1/7&1/2&1&2\\ 1/7&1/2&1/2&1\end{bmatrix}  \tag{2}\]  
The purpose of the experiment below is to test how much delay can a certain number of criteria contribute to our optimization algorithm. As a default setting, 4 simulated fog nodes, 12 services, 50 particles, and 200 epochs were used. A PC and a Raspberry Pi 4 are used as physical fog nodes to compare a powerful fog node running a simulation test and a fog node with limited hardware resources running a simulation test. Please see Figure 14 for more details. Figure 13: Inertia weight impact on convergence. A range of 3 to 5 criteria is mostly expected. However, to test a broader scope, the range of 10 to 30 is included. Furthermore, 3 to 5 criteria generate only 3 to 10 comparisons within the matrix. This has little effect on the response time. However, 10 to 30 criteria generate 40 to 435 comparisons, and the response time significantly rises in a hardware-restricted fog node device. Still, a 1 s response time is manageable in real applications even though 30 criteria are barely needed. The following experiment is meant to test the effect of CPU availability on the response time. The goal is to consider CPU utilization in such a case when additional services are to be hosted or some background processes take place, which overload the CPU. In order to learn the extent and a threshold to which a CPU can be overloaded by additional services, a CPU stress test was performed. Please see Figure 15 for more details. Raspberry Pi 4 was used as a physical fog node.