# Distributed Reliable and Efficient Transmission Task Assignment for WSNs
## 5 Reliable and Efficient Task Allocation Algorithm for WSNs
### Distributed Task Assignment
#### 5.2.2 Distributed Reliable and Efficient Task Allocation in Planar Topology
\tag{21}\]

where \(W_{rt}\) indicates the time of writing of the global view whenever it is updated and \(R_{rt}\) indicates the time of reading of the global view when the distributed task is assigned. #### 6.1.4 Energy Resilience of the Transmission in WSNs

The nodes can go down for various reasons, e.g., the time of life or for the specific protocol used. In order to evaluate the energy resilience of the transmission in WSNs, we quoted an index \(\eta\)[34] as shown in Equation (22), where \(N_{p}\) indicates the number of packets received by the sink after a fixed time, \(S\) indicates the number of initial active nodes, and \(D\) indicates the number of dead nodes after a fixed time. \[\eta=\frac{N_{p}}{S-D} \tag{22}\]

The index gives an indication of how efficient the network is in allowing information to be delivered considering both the number of packets that are running in the network and the number of nodes that are going out over time. ### Simulation

#### 6.2.1 Simulation Design

In order to carry out a reliable and efficient task assignment, two distributed task assignment strategies are proposed, namely TRETA-Cluster and TRETA-Multi-Sink. In this section, a simulation is carried out using TOSSIM (TinyOS Simulator). In order to evaluate energy consumption, this paper expands TOSSIM and adds a power consumption model. The performance of the strategies is analyzed and compared in three aspects: different network size, task arrival rate, and network update rate. In order to compare with the distributed task allocation, simulation of the centralized task allocation TRETA is also performed in the same network environment. The performance metrics analyzed include the energy allocated, the delay of successful allocation during the deadline, and the success rate of the task assignment. In addition, the simulation is carried out under the cluster topology and the multi-sink-based topology for the distributed task assignment. 1. Cluster topology The sensing area is 100 m \(\times\) 100 m, and the number of sensor nodes is 50 to 300. There is only one sink in the cluster topology, with the sink node located in the center of the sensing area and remaining nodes randomly deployed. 2. Multi-sink-based topology The deployment strategies of multiple sinks in a multi-sink-based topology include static and dynamic, random, and scheduled deployment methods. In the proposed simulation experiment,the static uniform deployment method is selected, with the number of sinks set to five, and the sensing area of the square is evenly divided into four sub-areas. One of the five sinks is located in the center of the sensing area, while the remaining four sinks are located in the center of the respective remaining four sub-areas. The five sinks remain fully connected, and the case where the sinks fail is not considered. The main simulation parameters are shown in Table 1. Three of the abbreviations (\(e_{dec}\), \(\epsilon_{amp}\), and \(e_{j}\)) represent the energy consumption of operating the radio model for each bit, the coefficient of the transmit amplifier, and the average calculated the energy consumption of the nodes in the network, respectively. [PERSON] et al. mentioned that wireless communication is usually the most energy-consuming process in traditional WSN applications [16]. Specifically, the energy required for a single bit transmission is 1000 times the energy consumed by calculating a single bit in classic 32-bit architecture, and thus the value of \(e_{j}\) is set to 0.05 nJ/b. The parameters of the task to be assigned are shown in Table 2, and three aspects are included: task type, transmission parameters, and task environment. Each simulation is executed for 120 minutes and repeated 500 times. For each performance index, we used the Monte Carlo method to obtain simulation results. The specific process is as follows: first, in the TOSSIM simulation environment, Python is used to generate a random number of each task parameter in the value interval based on a Poisson distribution.