# Reactive Planning-Driven Approach to Online UAVs Mission Rerouting and Rescheduling
## 4 CSP Formulation  
The proposed reaction to the occurrence of a disturbance \(IS(t^{*})\) can be reduced to dynamic re-routing and rescheduling of previously adopted routes \({}^{l}\Pi\), schedules \({}^{l}Y\) and  
Figure 3: Sub-mission \({}^{2}S\) after changed weather conditions: the wind speed increased to \(vw\ =\ 11\frac{m}{s}\) in the direction of \(\theta=110^{\circ}\)–\(130^{\circ}\). delivered goods \({}^{l}C\) stated in the basic proactive plan for the mission by the UAVs' fleet. This is a feasible adjustment of assumed \({}^{l}\Pi,{}^{l}Y\), and \({}^{l}C\) values to the changes in forecasted weather \(\mathcal{F}^{*}(\theta)\), and corrections introduced to the network \(G^{*}\) or orders \(Z^{*}\). In order to formally define the concept of disturbance \(IS(t^{*})\), let us introduce the concept of the state of the mission's implementation \(S\). The state of the mission \(S\) at the time \(t\) is defined as follows: \(IS(t)=(M(t),\ \mathcal{F}^{*}(\theta,t),{}^{*}G(t),Z^{*}(t))\) where \(M(t)\) is an allocation of UAVs to nodes at the time \(t\): \(M(t)=\big{(}N_{a_{1}},\ldots,N_{a_{k}},\ldots,N_{a_{k}}\big{)}\), where \(a_{k}\in\{1,\ldots,n\}\) determines the (delivery points) node \(N_{a_{k}}\) occupied by \(U_{k}\) (or the node the \(U_{k}\) is headed to). \(\mathcal{F}^{*}(\theta,t)\) is the weather condition forecast at the time \(t\). \({}^{*}G(t)\) is the graph model of the distribution network structure at time \(t\) (number and location of delivery points). \(Z^{*}(t)\) is the sequence of goods requested at the time \(t\). The state \(IS(t^{*})\) following condition \(\big{[}\mathcal{F}^{*}(\theta,t^{*})\
eq\mathcal{F}^{*}(\theta)\big{]}\lor \big{[}{}^{*}G(t^{*})\
eq G\big{]}\lor\big{[}Z^{*}(t^{*})\
eq Z\big{]}\) is called the disturbance occurring at the time \(t^{*}\). Occurrence of \(IS(t^{*})\) disturbance should be assessed in terms of its impact on the further course of the mission of \(S\) (that is, whether the value of the resistance function \(Y_{k,l}(\theta)\) is greater than \(\mathcal{F}(\theta)\)). If the implementation of the mission is at risk (\(Y_{k,l}(\theta)\
subseteq\mathcal{F}(\theta)\)), an attempt should be made to reschedule it. The following condition action (if-then) rules are used for this purpose:  
1. If the adopted mission plan \(S\) is not resistant to disturbance \(IS(t^{*})\) (\(\exists_{k\in\{1,\ldots,K\},\mathbb{I}\in\{1,\ldots,L\}}Y_{k,l}(\theta) \
subseteq\mathcal{F}(\theta)\)), a check should be carried out to see whether it is possible to adapt (re-plan) to the new conditions. That is, decide whether all UAVs in the air continue their current missions or make their appropriate corrections. 2. If there are UAVs (the set \(\mathcal{U}\)R) that cannot continue to fly due to disturbance \(IS(t^{*})\), then they should be returned to base, ensuring that airborne UAVs (the set \(\mathcal{U}\)\(\mathcal{U}\)R) can take over their tasks. 3. If the tasks of the UAVs returning to the base (the set \(\mathcal{U}\)R) cannot be taken over by UAVs still performing their missions, a check should be carried out as to whether the reserve UAVs available at base (the set \(\mathcal{U}\)B) can take over their responsibilities. This means the UAVs in the air continue their existing missions, while the reserve UAVs take over the liabilities of the UAVs returned to base. 4. If the reserve UAVs (the set \(\mathcal{U}\)B) are unable to take over the responsibilities returned to the base (the set \(\mathcal{U}\)R), then their activity should be suspended until the disturbance is resolved. The above rules have been used in the reactive mission planning method \(S\). The idea behind this method is as follows: during the implementation of the mission \(S\), there is a continuous monitoring of the state of the \(IS(t)\) (for \(t\in\{0\ldots H\}\)).