## 3 Improved Multi Mobile Agent Data Fusion Scheme
### Key Performance Metrics  
Although the mobile agent based model has many advantages over the client/server based model, the performance is not always the best. Due to overhead for generation and movement of mobile agents, the performance of different computer models also depends on other parameters related to network configuration. We focus on two criteria for evaluating the performance of these network models: execution time and energy consumption [46]. Execution time refers to the time between starting a task and the user receiving the result. It consists of three parts: \(t_{trans}\) is the time to send data and receive data, \(t_{ob}\) is the overhead time, and \(t_{proc}\) is the processing time. These times are affected to behave different by some factors, such as network  
Figure 15: RMS middleware action flow chart. transmission rate \(v_{n}\), data processing speed \(v_{d}\), the size of the packet \(s_{f}\), size of the mobile agent \(s_{a}\), message access overhead \(o_{f}\) (read data, analyze data, generate and write messages), the mobile agent cost \(o_{a}\), the number of \(P\) nodes, and the number of \(m\) mobile agents. Each mobile agent may access the number of sensor nodes. Therefore, we can express the execution time based on the C/S model [47] as follows:  
\[t_{cs}=mns_{f}/v_{n}+2 mno_{f}+mns_{f}/v_{d} \tag{42}\]  
where the data transfer time \(t_{trans}=mns_{f}/v_{n}\), overhead time \(t_{oh}=2 mno_{f}\), and data processing time \(t_{proc}=mns_{f}/v_{d}\). We can express the execution time of the computation model based on mobile agent with the following Formula:  
\[t_{ma}= \begin{array}{c}(m+n)s_{a}/v_{n}+2(m+n)o_{a}\\ +(m+n)s_{a}/v_{d}\end{array}  \tag{43}\]  
The proxy transfer time \(\mathrm{t_{trans}}=(m+n)\)\(s_{a}/v_{n}\), \(ns_{a}/v_{n}\) represents the time at which m mobile agents migrate between n sensor nodes. The mobile agent overhead time \(m\)s\({}_{a}\)/\(v_{n}\) means that the processing center receives the extra time of the mobile agent to access the sensing node on all migration paths. The proxy overhead time \(t_{oh}=2(m+n)\)\(o_{a}\), where \(2 moa\) is the time for AMS to allocate and receive \(m\) mobile agents, and \(2 no_{a}\) is the time for all local nodes to send and receive each mobile agent. The local code processing time is \(t_{proc}=(m+n)\)\(s_{a}/v_{d}\). Energy consumption refers to the total energy consumption of the entire implementation process. Like the rule of execution time, the two models of energy consumption depend on three factors: the energy consumption \(e_{trans}\) of data transmission, processing overhead energy consumption \(e_{th}\) and the energy consumption \(e_{proc}\) of data processing. For the C/S model and the model based on mobile agent, the energy consumption of the whole data processing of the sensor network is the same in the processing center and local sensor nodes. Therefore, we do not consider \(e_{proc}\) and \(e_{oh}\), and calculate energy consumption as follows:  
\[e_{cs}=e_{tran-cs}+2 mnP_{proc}o_{f} \tag{44}\]  
\[e_{ma}=e_{tran-ma}+2m(n+1)P_{proc}o_{a} \tag{45}\]  
where \(P_{proc}\) is the energy consumption of the processor under full load. In summarizing the previous simulation results, we conclude that the model based on mobile agent is not always better than the C/S model, and that different computing styles are only applicable to a particular network configuration. The computation based on a C/S model is better for few nodes or for limited raw data. The computation based on mobile agents is more suitable for a larger number of nodes, where the number of sensor nodes in the network may reach hundreds or even thousands. In this situation, reliability of links and effective bandwidth decreases, but the model based on mobile agents has higher energy efficiency and execution time. Then again, when the number of sensor nodes in the network is small, the model based on mobile agents will have a larger delay. Based on this, we summarize the following conclusions:  
1.