## 4 Experiments
### Results and Discussion
In case when the event occurrence probability is constant, the network lifetime is 16 h and 38 min (Figure 9). As shown in Figure 10, if the event probability is variable, the network lifetime reduces to 16 h and 12 min. The EDCR algorithm adapts CH rotation to the differences of residual energy between particular nodes that are caused by the unequal probabilities of event detection. However, this adaptation is performed with a larger delay, when compared to the proposed approach. The reason is that the decision about CH change in EDCR is taken after the predetermined amount of node's energy is consumed. In contrast, the proposed method adapts the CH rotation much faster as it directly takes into account the event probabilities and predicts the energy consumption of sensor nodes. Figure 8: Energy consumption by sensor nodes for RRCR algorithm and variable probability of event occurrence. Figure 9: Energy consumption by sensor nodes for EDCR algorithm and fixed probability of event occurrence. The results achieved for the proposed method are shown in Figures 11 and 12. In case when the probability of event occurrence is constant, the network lifetime was prolonged to 16 h and 48 min (Figure 11). Moreover, the average residual energy at the end of WSN lifetime is only 7 mWh. It means that the energy resources of sensor nodes are almost fully used when using the proposed approach. Figure 12 shows results obtained for the second scenario where probability of event occurrence is changing. In this scenario the WSN lifetime reaches 16 h and 35 min. In the left chart of Figure 12 it is possible to observe length differences of the horizontal bars that depict time intervals in which particular nodes take the CH role. These differences are caused by adaptation of the proposed CH rotation algorithm to currently estimated probabilities of event occurrence for each sensor node. As a result, all sensor nodes consume their energy resources at similar rates. Please note that the sloping lines, depicting energy level in Figures 11 and 12 (right chart) for nodes 1, 2, and 3, are very close to each other. Such observation confirms that the rate of energy consumption by sensor nodes is approximately equal when using the proposed method. The longer WSN lifetime is achieved as the cluster of nodes uses the available energy more effectively in comparison with the state-of-the-art methods. It should be noted that the obtained solution is very close to the optimal one, where all sensor nodes dies exactly at the same time. Additionally, Figure 13 shows the dependency between the percent of time when node gets CH role and the probability of event detection. These aggregated results relate to the example presented in Figure 11, where each node has fixed event occurrence probability. It can be observed that the more  
Figure 11: Energy consumption by sensor nodes for the proposed algorithm and fixed probability of event occurrence. Figure 12: Energy consumption by sensor nodes for the proposed algorithm with a variable number of detected events. Figure 10: Energy consumption by sensor nodes for EDCR algorithm with a variable number of detected events. events are detected by a node, the shorter is its time of performing CH role. This leads to balanced energy consumption of the three nodes. In case of node 3, for which the events are detected with the highest probability (0.5), the percent of time when the node acts as CH takes the lowest value (27.5%). In contrast, node 1 has lower probability of event detection than the other nodes (0.3) and takes the CH role for the longest time (37.5%). For comparison purposes, another CH rotation method called FDCR (Frame Driven Cluster-head Rotation) was tested. This simple method also takes into account the number of events detected and reported to CH by sensor nodes, but does not involve computations of the CH time limit \(TCH_{i}\), thus is slightly easier in implementation.