# Smartphone-Based Task Scheduling in UAV Networks for Disaster Relief
## 5 Problem Statement and Solution
### Task-Offloading Optimization
Otherwise, the position of the i-th bat remains \(\overrightarrow{x^{\prime}_{i}}(t)\):\[\overrightarrow{x_{i}^{\gamma}}(t+1)=\left\{ \begin{array}{ll}\overrightarrow{x_{i} }(t+1)&rand_{3}<A_{i}(t)andf(\overrightarrow{x_{i}}(t+1))<f(\overrightarrow{x_{ i}^{\gamma}}(t))\\ \overrightarrow{x_{i}}(t)&otherwise\end{array} \right. \tag{27}\]  
Finally, the pulse emission frequency and loudness are updated as  
\[r_{i}(t+1)=r_{i}(0)\cdot(1-e^{-\gamma t}) \tag{28}\]  
\[A_{i}(t+1)=\beta A_{i}(t) \tag{29}\]  
where \(\gamma\) and \(\beta\) are both preset parameters greater than 0, and \(r_{i}(0)\) and \(A_{i}(0)\) are the initial values of pulse emission frequency and loudness, respectively. In this system, \(r_{i}(0)=0.1\), and \(A_{i}(0)\) is a random number belonging to [0,1]. The next part of our algorithm is the immune algorithm. Population \(B=\{b_{1},b_{2},\ldots,b_{n}\}\), obtained with the BA part, is input into the immune algorithm part. Each bat in the population is regarded as an antibody in the immune cloning process, which is detailed below. Step 1: Randomly select k (k < n) antibodies, set them as sub-population \(Sub_{1}=\{b_{1}^{{}^{\prime}},b_{2}^{{}^{\prime}},\ldots,b_{k}^{{}^{\prime}}\}\), and then clone and replicate the sub-population to obtain a new population (\(Sub_{2}\)) with the following cloning rules:  
\[Sub_{2}=T_{c}(Sub_{1})=[T_{c}(b_{1}^{{}^{\prime}}),T_{c}(b_{1}^{{}^{\prime}}), \ldots,T_{c}(b_{k}^{{}^{\prime}})] \tag{30}\]  
where \(T_{c}(b_{i}^{{}^{\prime}})=q_{i}\times b_{i}^{{}^{\prime}}(i=1,2,\ldots,k)\) and \(q_{i}\) is the clone multiplicity of \(b_{i}^{{}^{\prime}}\), proportional to the fitness of \(b_{i}^{{}^{\prime}}\). Step 2: Perform high-frequency mutation for each individual in population \(Sub_{2}\); the mutation operator can adapt with evolution, concerning both the number of iterations and individual fitness. For any individual \(b_{i}^{{}^{\prime}}=(b_{i1}^{{}^{\prime}},b_{2^{\prime}}^{{}^{\prime}},\ldots, b_{ij^{{}^{\prime}}}^{{}^{\prime}},\ldots,b_{in}^{{}^{\prime}})\) in \(Sub_{2}\), perform the following mutation:  
\[B_{ij}^{{}^{\prime}new}=\left\{ \begin{array}{ll}\sim b_{ij}^{{}^{\prime} old}&rand_{4}<\phi(t)\quad\text{and}\quad rand_{5}<\Delta\\ b_{ij}^{{}^{\prime}old}&else.\end{array} \right. \tag{31}\]  
\(\phi(t)\) in Equation (31) is  
\[\phi(t)=1-r_{1}^{[1-(t/T)]^{b}} \tag{32}\]  
where \(b\) is a positive constant and \(r_{1}\in(0,1)\). In early iterations, \(r_{1}^{[1-(t/T)]^{b}}\) is small, making \(\phi(t)\approx 1\), indicating a high probability of mutation; in later iterations, the population characteristics gradually approach the ideal state in evolution, and \(\phi(t)\approx 0\), allowing for local search in a small space. Further expand \(\Delta\) as  
\[\Delta=1-r_{2}^{R^{\tau}} \tag{33}\]  
where \(r_{2}\in(0,1)\) and \(\tau\) is used for regulating the range of the search domain and typically takes values in [2,5,31]. \(R\) in the above equation is denoted by  
\[R=1-\frac{fit(b_{i}^{{}^{\prime}})}{fit_{max}} \tag{34}\]  
where \(fit(b_{i}^{{}^{\prime}})\) represents the fitness of antibody \(b_{i}^{{}^{\prime}}\) and \(fit_{max}\) is the maximum fitness value, which is the aggregation density of the individual. Step 3: Select the best individual from the cloned mutated individuals as the next generation. The third part is our population adjustment evaluation algorithm, which we designed in order to adjust the initial population for each iteration. This algorithm ensures the consistency of the initial data size of each iteration and the optimization effect in each iteration. Firstly, the obtained solution set is screened according to the constraints in problem \(P(22)\), and the solutions that do not meet the constraints are screened out. Due to the significant difference in data distribution between the two optimization indexes, we make unified adjustments to their distribution ranges based on their data distribution so that the importance weights of the two indexes are consistent in the final ranking.