## 4 Simulation and Analysis
### Simulation Results: The Dynamic Occasion  
In this simulation, at each time slot, each sensor has the probability, \(0.05\), to move from its current position to a random position, and at each time slot, a new sensor will arrive at the network with the probability \(0.2\) at a random position. When an existing sensor moves to a new position or a new sensor joins the network, its physical neighbour set and cooperative neighbour set will be initialised. The node's physical neighbour set is built based on its communication radius. This means that any node in this node's communication radius will become this node's physical neighbours. The node's cooperative neighbour set is initialised in the same way as the physical neighbour set. In practice, the movement of a sensor is usually based on some purpose, so the sensor does not move to a random position. In this simulation, the aim is just to demonstrate how the proposed framework works in a dynamic WSN, so we simplified the movement of a sensor by setting its movement destination to a random position.  
In Figure 3, the main trend of the simulation results is similar to that in a stationary WSN, but the overall performance of the three routing approaches and their multi-agent framework-based enhanced versions is improved compared to that in a stationary WSN. This is because sensors movement can, to some extent, balance the energy consumption in the network. In a stationary WSN, those sensors that are neighbours of the sink nodes are very likely to be depleted, because they are the final hops to the sink nodes and all of the packets have to be relayed by them. Therefore, if sensors can move, those final hop nodes will most likely move away and, likewise, other sensors will most likely be the final hop nodes; so, the energy consumption can be balanced to some extent. Analogously, if  
Figure 3: Performance of routing approaches in a dynamic WSN. (**a**) Average delivery latency; (**b**) successful delivery ration (%); (**c**) number of live nodes; (**d**) total sensing coverage (%).  
network, the energy of the whole network increases, which is good for the network in various aspects. There are still some specific phenomena that should be noted. In Figure 3a, the average delivery latency in LEACH-revised in the final time slots is longer (_i.e._, worse) than that in gossiping and GEAR, which is different from Figure 2a. This is ascribed to the fact that routing in LEACH-revised is based on cluster heads, so new sensors joining or sensor movement cannot effectively shrink the routing path, and thus, the latency of packet routing cannot be improved very much. Due to the same reason, the difference of the final performance, regarding successful delivery ratio (Figure 3b) between LEACH-revised and gossiping is reduced compared to Figure 2b. On the other hand, in Figure 3c, the difference in the number of live nodes in LEACH-revised and gossiping in the final time slots is enlarged compared to Figure 2c, which can reflect the fact that LEACH-revised is quite good at balancing energy-consumption. Finally, again, using the proposed framework can improve the performance of all three routing approaches in a dynamic WSN.  
In summary, using the proposed framework, the performance of the selected three routing approaches in both stationary and dynamic WNSs can be improved by around 10%-15% with regard to the four quantitative metrics, which demonstrates the potential usefulness of this framework.