# Wildlife Monitoring Using a Multi-UAV System with Optimal Transport Theory
## 3 Method
### OT-Based Multi-UAV Exploration: Time-Invariant Case
#### 3.2.1 A Three-Stage Approach  
During the monitoring mission, each agent follows the three-stage approach: the next goal point determination, the weight update, and the weight information exchange and update stage. Each stage is explained in detail as follows. * Next goal point (\(gx_{T+1}^{k}\)) determination stage:  
Given that the agents are located at \(\{x_{T}^{k}\}_{k=1}^{n_{a}}\) at any discrete-time step \(T\in\mathbb{N}\), the agents determine the next goal position for the next time step \(\{\bar{s}x_{T+1}^{k}\}_{k=1}^{n_{a}}\) as following. Each agent creates a circle with the center at the current agent location \(x_{T}^{k}\) and the initial radius \(r_{0}\). The radius of the circle increases incrementally by a radius increment \(\delta\) until the agent finds \(h\) number of sample points within the circle. Then, the agent generates all possible trajectories connecting the sample points found in the circle, starting from the current agent position \(x_{T}^{k}\). To generate the possible trajectories, each agent creates its own tree structure representing all candidate trajectories formed by connecting the sample points in the circle starting from the current agent position \(x_{T}^{k}\). For \(h\) numbers of sample points within the search circle, a total of \(h!\) trajectories can be generated by each agent in the tree structure. A schematic for the process to determine one possible trajectory is illustrated in Figure 4a and the complete tree structure is presented in Figure 4b (in this case, \(h=3\)). Figure 3: Schematic of UAV points with their relative locations at different time steps for two agents. Initial points: \(\{x_{t=1}^{k}\}_{k=1}^{2}\), past points: \(\{\{x_{t}^{k}\}_{t=1}^{T-1}\}_{k=1}^{2}\), and current and future points: \(\{\{x_{t}\}_{t=T}^{M_{a}}\}_{k=1}^{2}\). The sequence of sample points in \(l\)th candidate trajectory can be denoted by \(\sigma^{l}_{j},j\in\{1,2,\ldots,h\}\), where \(j\) indicates the sample point index and \(l\in\{1,2,\ldots,h!\}\) is an index that represents a specific candidate trajectory in the tree structure. In the illustrative example provided in Figure 4, the sequence of sample points in the third trajectory (when \(l=3\)) is given by \(\{\sigma^{l=3}_{j}\}_{j=1}^{3}=\{y_{2},y_{1},y_{3}\}\). Once completed, the cost corresponding to each trajectory is calculated, where the cost function is defined to determine the local-optimal trajectory for \(k\)th agent as follows. \[C^{k}(l)=\frac{\|y_{\sigma^{l}_{1}}-x^{k}_{T}\|}{n^{k}_{T}(y_{\sigma^{l}_{1}}) }+\sum_{j=2}^{h}\frac{\|y_{\sigma^{l}_{j}}-y_{\sigma^{l}_{j-1}}\|}{n^{k}_{T}( y_{\sigma^{l}_{j}})}, \tag{5}\]  
where \(y_{\sigma^{l}_{j}},j=1,\ldots,h\), denote the sample points found within the circle such that \(\sigma^{l}_{j-1}\
eq\sigma^{l}_{j}\) and \(n^{k}_{T}(y_{\sigma^{l}_{j}})\) is the weight information of the sample points located within the circle known to agent \(k\). The cost function \(C^{k}(l)\) in (5) is defined in this way to ensure that each agent follows a trajectory with a shorter travel length in terms of the total Euclidean distance as well as that connects the sample points \(y_{j}\) with the high weights \(n^{k}_{T}(y_{j})\) in the circle first in order to drive the agent towards high priority sample points. Given the definition of the \(h\)-step trajectory from time \(T+1\) to \(T+h\) for agent \(k\), \(x^{k}_{T+1:T+h}:=\{x^{k}_{T+1},x^{k}_{T+2},\ldots,x^{k}_{T+h}\}\), the candidate trajectory for the agent \({}^{c}x^{k}_{T+1:T+h}(l)\), \(l=1,2,\ldots,h!\), can be obtained from the tree structure. From the candidate trajectories, the \(h\)-step local-optimal trajectory \({}^{g}x^{k}_{T+1:T+h}\) is determined by  
\[{}^{g}x^{k}_{T+1:T+h}=\{{}^{c}x^{k}_{T+1:T+h}(l^{*})\,|\,l^{*}=\text{argmin}_{ l}C^{k}(l)\} \tag{6}\]  
Each agent considers the first point of the \(h\)-step local-optimal trajectory \({}^{g}x^{k}_{T+1:T+h}\) as the next goal point \({}^{g}x^{k}_{T+1}\) in the next time step \(T+1\) and then, heads toward that location with the given UAV dynamics.