# Multi-Agent Dynamic Fog Service Placement Approach
## 6 Discussion  
Different experiments were conducted with the prototype to determine the usability of the fog service placement orchestrator as a multi-agent system. The JADE platform was used to implement fog computing services as agents in Java language. A PC was used as a high-resource fog node, and Pi 4 stood for a low-resource node. As for an increased platform security, the JADE-S security add-on was integrated. A Raspberry Pi 4 stress package was installed for a stress test, and measurements were taken for energy consumption. Additionally, the inertia weight coefficient and a matrix size test were completed to determine the best performance choices. The inertia weight, according to the publication [63], demonstrates a clear balanced relationship between an exploration and an exploitation. It is possible to avoid a premature convergence by choosing the right inertia weight \(w\)[65]. The inertia weight of 0.6 showed the best results, since it leads, on average, to the lowest number of failures in finding the global optimum. Meanwhile, the number of criteria is used for a judgement matrix to highlight the importance of certain qualities such as security, CPU, RAM, and power. Four criteria were used for all other experiments but, as is visible from the results of the current study, even 30 criteria with 435 comparisons have a barely visible impact on a high-resource fog node performance. As for a low-resource fog node and a 30-criteria matrix, a service placement can be found in less than 1 s, which is still usable in field conditions. It is possible to conclude based on the CPU stress test that at least 20% of CPU must be available for calculations. Otherwise, the response time increases two or three times. It is not that relevant if the number of particles is low, suggesting that the calculations are relatively simple, but it becomes critical with more complex ones. A CPU stress test has the biggest impact on the service placement phase in contrast to other ones that are relatively simple. When it increases from 1.1 s to 3.2 s, it may have a considerable negative effect on tasks that require a short response time. The security add-on JADE-S did not add any clearly observed delay. Service placement decision making takes most of the time, but it does not require any agent intercommunication that is signed, encrypted, or both. Other processes are less complicated and less time-consuming. Some spontaneous time increases or decreases were noted but they were irregular and did not seem to play a significant role. A USB tester and an energy meter were used to measure the voltage and current. Power or energy were measured or calculated as required. A self-const of the JADE platform calculations for 1 month would make only around 0.1 EUR, and the availability of Raspberry Pi 4 as a hardware would add another 0.4 EUR. However, mobility requires \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Nodes** & **Services** & **Particles** & **Epochs** & **Response (s)** & **Energy (W/h)** \\ \hline
4 & 12 & 200 & 300 & 2.032 & 0.00178 \\
6 & 18 & 300 & 300 & 4.853 & 0.00426 \\
8 & 24 & 400 & 400 & 5.72 & 0.00502 \\
10 & 30 & 500 & 600 & 15.082 & 0.01325 \\
12 & 36 & 600 & 700 & 21.118 & 0.01855 \\
14 & 42 & 600 & 800 & 26.305 & 0.02310 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Scalability parameter sets. one to use batteries, and even such energy needs can be an issue when the capacity of the batteries is low enough. The experimental results allow us to claim that this solution is applicable in a small fog-computing infrastructure. It offers dynamic and distributed decision making. A distributed decision-making process is more resilient than a central architecture due to the absence of a single point of failure. Any fog node can make decisions to launch, place, and eliminate relevant services. These decisions are synchronized afterwards. If there are any failures, services can be relocated. It is also possible to sign and to encrypt agent messages for additional security.