## 4 Simulation and Evaluation
### Multi-MAF Evaluation  
In the first scenario, we have sources generating random data during the time, according to a Gaussian distribution that represents the occurrence of correlated detections of events. We set the average of this distribution in the middle of the simulation time of 4000 s and standard deviation of 100 s. The duration of the data generation was a random value between 1 s and 100 s.  
Figure 9(a) shows the summary of the consumed energy in the entire network after the specified simulation time, considering that the number of source nodes detecting an event varied from 5 to 50 nodes, randomly chosen. In this simulation, with a not very intense traffic, all algorithms delivered nearly 100% of the packets (this graphic was omitted). Regarding the energy consumed, Multi-MAF outperforms the other algorithms independent of the number of sources. With the lowest number of sources (5 sources) Multi-MAF and SID consume almost the same energy, however, the difference between them becomes close to 100% with 50 sources. The advantage of Multi-MAF is the adoption of the reactive behavior when the network is inactive, corresponding to energy savings related to EF-Tree, and the flooding avoidance of new sources when the proactive behavior is assumed, which represents a high cost to SID as the number of sources increases. This proactive behavior is taken when the _MAF_ detects an increase in the traffic, so its value becomes higher than the threshold 0.1.  
Figure 9: Performance of Multi-MAF under different traffic characteristics.  
Uncorrelated detections  
In the second scenario, based on the previous one, we represent the detection of uncorrelated events. The variation on detection rate is represented by different number of sources generating data randomly distributed over the simulation time of 4000 s according to a Uniform distribution.  
In Figure 9(b), SID and Multi-MAF outperform EF-Tree when the number of sources is small (less than 25). In this case, Multi-MAF operates just like SID, due to a low number of detections by Multi-MAF's _MAF_ and consequently no proactive behavior is taken. This advantage happens because, with this reactive behavior, the routing infrastructure is created and maintained only when necessary and constant proactive behavior is unnecessary with a low amount of detections. However, when the traffic increases, EF-Tree begins to be more suitable, because it builds the routing infra-structure for all nodes at once and this proactive behavior is compensated by initial floodings of SID for path discovery. In this case, Multi-MAF's performance becomes closer to the EF-Tree, outperforming SID. The reason is that MAF detects the high traffic condition and the proactive behavior is chosen. Again, since all algorithms present a high packet delivery ratio, this graphic was omitted.  
In the last case, with high number of detections, Multi-MAF and EF-Tree performances are not the same, because since the simulation time is kept constant, the increasing number of sources leads to a decreasing inactivity time, amortizing the cost of the EF-Tree from the start of simulation. Since Multi-MAF always starts to operate as SID, changing to EF-Tree only when the MAF detects this traffic condition leads to initial data flooding. In a real event-driven scenario, we can expect to have longer inactivity periods than in the previous simulated scenario. Thus, the energy cost of the EF-Tree shifts to a higher value due to its proactive characteristic which results in a better relative performance for both SID and, in special, Multi-MAF.