## 4 The Scheduling Algorithm Based on GA
### Carrier Aircraft Landing Recovery Dispatch
That is, if carrier aircraft j lands before carrier aircraft \(i\), then \(T_{j}^{m}\) must be larger than \(T_{i}^{m}\). \[T_{j}^{m}>T_{i}^{m} \tag{36}\]  
(5) It is agreed that at most one carrier aircraft can carry out the landing recovery operation at each time. In Equation (37), if \(l_{i}^{m}=1\), then carrier aircraft \(i\) lands in this cycle; if \(l_{i}^{m}=0\), then carrier aircraft \(i\) does not land in this cycle. \[\sum_{i=1}^{m}l_{i}^{m}=1 \tag{37}\]  
In summary, GA is used to make reasonable plans for job scheduling, and the operation time planning of carrier aircraft is realized. The specific flow of the algorithm is shown in Figure 7.  
In order to comprehensively consider the operation process of the aircraft, this paper uses the two-layer GA for scheduling optimization. The inner GA is mainly aimed at landing and optimizes the latest completion time of the landing. In the outer GA, the ejection dispatch is considered to optimize the latest takeoff completion time. Under the outer individual (a takeoff sequence), the landing schedule is optimized by calling the inner GA, and the inner optimal solution and the corresponding optimal fitness are returned. Define the objective function as Equation (38), Among them, \(C_{L}^{max}=max(T_{in}^{i})\) represents the maximum completion time of takeoff and \(C_{D}^{max}=max(T_{n}^{j})\) represents the latest completion time of landing. \(\omega_{L}\) and \(\omega_{D}\) denote the corresponding weight values, which can be used to adjust the emphasis of the algorithm. \(P\) is the penalty generated by violating the constraint. \[minF=\omega_{L}C_{L}^{max}+\omega_{D}C_{D}^{max}+P \tag{38}\]  
The pseudocode for the algorithm is as follows (Algorithm 1):  
```
Input: Population size \(P_{D}\), \(P_{L}\), maximum algebra \(G_{D}\), \(G_{L}\), crossover rate \(p_{c}\), mutation rate \(p_{m}\), penalty factor \(\lambda_{D}\) and \(\lambda_{L}\), optimal scheduling sequence \(\pi^{*}\) and \(\sigma^{*}\). // Outer initialization Initialize population \(P_{D}~{}=~{}\left\{\sigma^{1},~{}\ldots,~{}\sigma^{P_{D}}\right\}\) randomly for \(g_{D}=1\) to \(G_{D}\) do for each \(\sigma\) in \(P_{L}\) do // Inter GA (\(\pi^{*}\), \(F_{L}\)*) = InnerGA(Aeroplane set, Resource collection, Safe interval, Population size, Maximum algebra, Crossover rate, mutation rate, Penalty factor) \(C_{L}^{max}\leftarrow\) computeDepartureTime(\(\pi^{*}\)) \(C_{D}^{max}\leftarrow\) computeLandingTime(\(\sigma\)) \(penalty_{D}\leftarrow\) sumOverConstraints(\(\sigma\), \(\ldots\)) \(F_{D}\left(\pi\right)~{}\leftarrow~{}\omega_{L}C_{L}^{max}+\omega_{D}C_{D}^{ max}+\lambda_{D}penalty_{D}\) end for \(P_{L}\leftarrow\) GA_Operator(\(P_{L}\), \(p_{c}\), \(p_{m}\)) // Selection, crossover, mutation, elite retention if Converged(\(P_{D}\)) then break end for \(\sigma^{*}\leftarrow\) bestIndividual(\(P_{L}\)) (\(\pi^{*}\), \(F_{L}\)*) = InnerGA(Aeroplane set, Resource collection, Safe interval, Population size, Maximum algebra, Crossover rate, mutation rate, Penalty factor) return \(\sigma\)*, \(\pi\)*, \(C_{D}^{max}(\sigma\)*), \(C_{L}^{max}(\pi^{*})\)
```  
**Algorithm 1**Scheduling optimization algorithm based on two-layer GA.  
```
Input: Population size \(P_{D}\), \(P_{L}\), maximum algebra \(G_{D}\), \(G_{L}\), crossover rate \(p_{c}\), mutation rate \(p_{m}\), penalty factor \(\lambda_{D}\) and \(\lambda_{L}\), optimal scheduling sequence \(\pi^{*}\) and \(\sigma^{*}\).