# Inspired from Ants Colony: Smart Routing Algorithm of Wireless Sensor Network
## 4 Simulation Results  
The energy consumption obtained by each sensor is calculated and then the results are plotted. These figures are obtained, each sensor sends data to its chosen neighbour using the SRA algorithm, the sensor aggregates the data of its predecessor and sends all data to its successor. This procedure is repeated until aggregated data reaches the base station. Whole simulations depend on this coming protocol: we consider 25 nodes of wireless sensor networks arbitrarily dispersed over an area of 25 m \(\times\) 25 m. The base station is in the middle. Furthermore, we neglect the effect caused by signal collision and interference in the wireless channel. On account of limited energy of nodes, during the simulations, the energy diminishes when a node sends or receives data and whenever it aggregates data. In case a node runs out of energy, it can't send or receive data. Therefore, it will be ignored in the network in future iterations. The parameters shown in Table 1 are used in our  
From iterations 1 to 15, Figure 3, we see that the minimum path is 253.2010 m and the maximum path is 369.8450 m.  
From iterations 16 to 20, Figure 4, we see that the minimum path is 290.5974 m and the maximum path is 349.5204 m.  
From iterations 21 to 35, Figure 5, we see that the minimum path is 262.4805 m and the maximum path is 370.5428 m.  
From iterations 31 to 45, Figure 6, we see that the minimum path is 272.8723 m and the maximum path is 346.5317 m.  
We see in Figures 3-6 that the path chosen during these iterations is not always the smallest path even if the network knows the smallest way because the residual energy of the nodes has also been taken into account. The source is also not always the same because the goal of our paper is to balance the energy consumption in all the nodes.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline \(E_{elec}\) & 50 nJ/bit \\ \(E_{fs}\) & 10 pJ/bit/m\({}^{2}\) \\ \(E_{mp}\) & 0.0013 pJ/bit/m\({}^{4}\) \\ \(E_{0}\) & 0.5 J \\ \(k\) & 4000 bits \\ \(E_{DA}\) & 50 nJ/bit/message \\ \(d_{0}\) & 88 m \\ \(\alpha\) & 4 \\ \(\beta\) & 2 \\ \(\gamma\) & 2 \\ \(\delta\) & 4 \\ \(\rho\) & 0.02 \\ initial value of \(\tau_{i,j}\) & 0.0001 \\ initial value of \(\eta_{i,j}\) & 0.0001 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Radio characteristics used in our simulations.  
Figure 2: The sink in the middle and the nodes are scattered arbitrarily.  
Figure 4: The constructed paths in iterations 16–20.  
Figure 5: The constructed paths in iterations 21–35.  
Figure 3: The constructed paths in iterations 1–15.  
In Figure 7, the energy consumed by each sensor increases almost equitably for all sensors.  
In Figure 8, the residual energy of each sensor decreases almost equitably for all sensors.  
Figure 6: The constructed paths in iterations: 36–50.  
Figure 7: Energy consumption by each node in each iteration.  
In the Figure 9, we have increasingly sorted the energy consumption of each sensor to obtain these comparable results:  
The total energy consumed by each sensor is almost identical to the average energy consumed: 0.3757 j.  
In Figure 10, we have decreasingly sorted the residual energy of each sensor to obtain these comparable results:  
The residual energy of each sensor is almost the same as the average residual energy: 0.1242 j, the difference between the average value and the maximum and minimum values, respectively, are: 0.07079 j and 0.06663 j.  
Figure 8: Residual energy of each sensor for 50 iterations.  
Figure 9: Energy consumed by each sensor for 50 iterations.