## 4 Cooperative Stochastic Transmission Planning
### SCB from a WSN with Linear Distribution of Motes in Horizontal Plane  
#### 4.2.1 Uniform Linear Distribution  
The maximum theoretical gain for this case is \(G_{N}\) = \(N\), where \(N\) is the number of motes. This would be achieved with perfect synchronization without delays and it is obtained from the theoretical antenna Array Factor (\(AF\)) for the \"broadside\" case [59], \(\theta\) = \(90^{\circ}\), being \(\theta\) the angle with respect to the array axis. We consider a spatial separation between modes \(d_{k}\) = 70 m, and \(\alpha_{k}\) would be the temporal offset by desynchronization. It is also considered the parameter \(a_{k}\) that would be a power correction factor for each mote that may differ within the motes of WSN by the level of load of the batteries or the characteristics of the terrain where each mote is located. This parameter would include possible blockage, reflections in objects around or soil properties such as moisture. Thus, the general expression for the gain of \(N\) motes is:  
\[G=\left[AF\right]_{N}=\sum_{k=1}^{N}a_{k}e^{i(kd_{k}\cos\theta-\alpha_{k})} \tag{3}\]  
The delays or time offsets of the clocks in the synchronization process are measured in the motes and these are used to simulate their operation. Figure 4 presents the distribution of the time offsetsafter a process of synchronization of the motes of the WSN [14; 15]. The measured time delays are adjusted to a normal distribution whose result corresponds to (\(\mu\), \(\sigma\)) = (0.03, 165.22) _ns_, with a 95% confidence interval [\(-\)7.31, 7.37]_ns_. These results are used to launch a large number of Monte Carlo simulations of SCB transmissions in which the gain is calculated, in each transmission attempt from attempt \(n\) = 1 to \(n\) = 100, and the radiation behavior of the WSN is analyzed. The behavior of WSNs is studied with several numbers of motes, from \(N\) = 2, 3... to 20 motes, in which the temporal delays are introduced following the distribution function obtained experimentally. Figure 5 shows the broadside gain obtained in the case of a WSN with 20 motes. This is the case in which it would be expected to achieve greater gain, because the greater the number of motes and the more signal would be added in phase in case of constructive interference. Figure 5 shows the distribution of results for 100 transmission attempts, where the theoretical maximum achievable would be \(G\) = 20. We observe a Gaussian distribution, in which a gain of 20 is not reached, but in which an acceptable gain is obtained, \(G\) = 3.7 \(\pm\) 1.9, (95% CI [3.3, 4.1]). But, more importantly, we also observe that the right tail of the distribution approaches 10, reaching a maximum value of 8.5. That is to say, the maximum gain is not reached, which is logical because the synchronization of all of them is not possible, but if the WSN successively launches transmissions, following the procedure described above, there would be a hope of obtaining a gain of 3.7, with a confidence interval CI 95% [3.3, 4.1]. Moreover, by making 100 transmissions, a gain greater than 8.4 would be achieved in transmission attempts \(n\) = 52, 53 and 90. Although there is a significant average gain, we are clearly interested in obtaining the maximum gain, or at least a large percentage of the maximum gain. Thus, a WSN with 20 motes has a gain greater than 40% of the maximum gain in \(n\) = 52 (\(G\) = 8.4), \(n\) = 53 (\(G\) = 8.5), and \(n\) = 90 (\(G\) = 8.4). Figure 6 shows the WSN gain for each attempt, and also presents the results for a WSN of five motes and a WSN of nine motes, that is \(N\) = 5 and \(N\) = 9 as well as \(N\) = 20 already defined and the WSN are denoted as WSN-5, WSN-9 and WSN-20 respectively. It is interesting to see what happens when we increase the number of motes that make up the transmission. From Figure 6, the greater the number of motes, the greater the gain in an SCB, but there is no linearity between the increase in the number of motes and the gain.