# Reactive Planning-Driven Approach to Online UAVs Mission Rerouting and Rescheduling
## 4 CSP Formulation
If at the state \(IS(t)\), the following condition holds \(\big{[}\mathcal{F}^{*}(\theta,t^{*})\
eq\mathcal{F}^{*}(\theta)\big{]}\lor \big{[}{}^{*}G(t^{*})\
eq G\big{]}\lor\big{[}Z^{*}(t^{*})\
eq Z\big{]}\) (i.e., there is a change in the weather forecast or in the structure of the distribution network, and the size of the requests, etc.) and the mission \(S\) is under threat (i.e., at least one of the UAVs will not return to base due to low battery), then an attempt must be made to replan. This type of reaction is performed by the function solve, the purpose of which is to designate a mission \({}^{*}S\) adapted to the new conditions determined by the disturbance \(IS(t)\). In practice, it comes down to solving the relevant constraints satisfaction problem \(CS({}^{\mathcal{O}}\mathcal{U},S,\ IS(t))\) (where:\({}^{\mathcal{O}}\mathcal{U}\) defines the fleet designated by condition action rules 1-4). The relevant constraints distribution process follows the sequence where at first an attempt is made to designate the mission \({}^{*}S\) for the fleet \(\mathcal{U}=\mathcal{U}\) (according to the rule 1). In the event of failure, an attempt is made to designate this for the fleet \(\mathcal{U}=\mathcal{U}\)\(\mathcal{U}\)\(R\) (according to rule 2) and then for the fleet \(\mathcal{U}=(\mathcal{U}\)\(\mathcal{U}\)\(\mathcal{U}\)\(R)\) (according to rule 3). If an admissible solution \({}^{*}S\) still does not exist, then the mission plan currently used should be modified (due to the reduce function) in such a way that it removes the UAVs' sub-missions that are not resistant to disturbance \(IS(t)\) (according to rule 4). It should be noted that the designation of mission \({}^{*}S\) is associated with the designation of routings \({}^{l}\Pi\), schedules \({}^{l}Y\) and delivery sequences \({}^{l}C\) throughout the remaining time horizon \(\{t\ldots H\}\). Due to the disturbance \(IS(t^{*})\) occurrence, the proposed reactive planningalgorithm (implemented in the IBM ILOG environment) generates the end-to-end paths that modify previously planned routes, restoring the ability to implement the designated mission delivery plan. The mathematical formulation of the constraint satisfaction problem \(CS\big{(}^{\mathcal{U}}\mathcal{U},S,~{}IS(t)\big{)}\) aimed at contingency planning for the UAVs' mission design employs the following parameters, variables, sets, and constraints:  
Parameters: \begin{tabular}{l l l} \({}^{1}G\) & the graph of a distribution network for sub \(-\) & \({}^{1}\mathcal{U}\) & the subset of UAVs \({}^{1}\mathcal{U}\subseteq\) \\  & mission \({}^{1}S\), & \\ \(z_{\lambda}\) & the demand at node \(N_{\lambda}\), \(z_{1}=0\), & \\ \(d_{\beta,\lambda}\) & the distance between \(N_{\beta}\), \(N_{\lambda}\), & \\ \(t_{\beta,\lambda}\) & the travel time between \(N_{\beta}\), \(N_{\lambda}\), & \\ \(w\) & the time spent on take-off and landing of a & \\  & UAV, & \\ \(Q\) & the maximum loading capacity, & \\ \(IS(t)\) & the state of UAV's mission, & \\ \(H\) & the time horizon, & \\ \(Y_{\lambda,I}(\theta)\) & the weather resistance function, & \\ \(\mathcal{F}(\theta)\) & the forecasted wind speed, & \\ \(va_{\beta,\lambda}\) & the air speed between nodes \(N_{\beta}\), \(N_{\lambda}\), & \\ \(\varphi_{\beta,\lambda}\) & the heading angle of vector \(va_{\beta,\lambda}\), & \\ \(ND\) & the set of delivery points, & \\ \(\mathcal{U}^{\lambda}\) & the set of UAVs allocated at base \(N_{\lambda}\in NB\), & \\ \(l_{\beta}k\) & the take \(-\) & \\  & off time of \(U_{k}\) before the disturbance \(IS(t^{*})\), & \\ \({}^{1}y_{\lambda}^{k}\) & the time at which \(U_{k}\) arrives at node \(N_{\lambda}\) & \\  & before the disturbance \(IS(t^{*})\), & \\ \end{tabular}   
Decision Variables: