# Devising Mobile Sensing and Actuation Infrastructure with Drones
## 2 Designing DaaG
### Main Functions of DaaG
#### 2.3.4 Data Transfer Method Selection  
To select the appropriate data transfer method, DaaG has to recognize environment variables, such as network state, service type, etc. After that, DaaG calculates a data transfer method score, which directly determines the data transfer method, as follows:  
\[S_{dt}=\sum_{i=1}^{n}\alpha_{i}\times\theta_{i}, \tag{4}\]  
where \(\theta_{i}\) is the environment variable, such as loudness, temperature, light intensity and humidity. \(\alpha_{i}\) is its weight value. For example, in the case of a wildfire detection system, the weight of temperature and light intensity would be higher than that of loudness.  
Furthermore, light intensity and temperature are usually low in normal situations. In this case, the system does not need to send data continuously. Therefore, using the data ferry method to deliver the data reduces the energy consumption with no setbacks. However, if a wildfire occurs, the light intensity and temperature of the surveillance area will be increasing, and an immediate and continuous data report is required to understand the situation with accuracy. In this case, continuous data transmission with a multi-hop network is required.  
The effect of environment variables could be adjusted by modifying environment weight value \(\alpha_{i}\). This value could be determined by evaluating the sensors. Following the \(S_{dt}\), DaaG chooses the data transfer method between data ferry and multi-hop network when \(S_{dt}<Th_{S_{dt}}\). \(Th_{S_{dt}}\) is the threshold value of the data transfer method score, and we calculate \(Th_{S_{dt}}\) as follows:  
\[Th_{S_{dt}}=k\times\frac{n_{d}}{(n_{a}+n_{s})\times dist(A,S)} \tag{5}\]  
where \(n_{d}\) is the number of drones, \(n_{a}\) and \(n_{s}\) are the number of actuators and the sensors, \(dist(A,S)\) is the distance between the geographical center points of the actuating area and sensing area and \(k\) is the coefficient to scale the \(Th_{s_{dt}}\). The number of drones \(n_{d}\) is proportional to the throughput of the data ferry method. However, the other values, \(n_{a}\), \(n_{s}\) and \(dist(A,S)\), make the travel time of the drone longer. Therefore, these values are inversely proportional to the throughput of the data ferry method. We set the value of \(k\) as 1600 based on our simulation result.  
Furthermore, this equation can be used to optimize the number of drones to deploy. After the deployment of the sensors and the actuators, the manager of the system could collect data from the sensors and get \(S_{dt}\) in the normal state. With the accumulated information of \(S_{dt}\), the manager could set the threshold value \(Th_{S_{dt}}\) and calculate the minimum of drones to be deployed. With this approach, we could optimize the configuration.  
In the multi-hop network method, data can be continuously transferred. Therefore, it is favored when the service wants guaranteed real-time information. The communication link, however,suffers from interference from other drones. Moreover, many drones are needed to cover separate networks that are far from each other, which can cause high capital and operational expenses. This network structure can also cause a battery imbalance problem, which is a major issue in sensor networks.  
In the data ferry method, the data are uploaded to the drone with maximum throughput; the drone flies to the destination, and it comes back for additional data uploading. As it is free from interferences, it encounters a much lower bit error rate. However, the total throughput of the data ferry case is related to the flying distance and speed of drones. Therefore, network efficiency may be decreased when the speed of a drone is slow or the data size is small.