# An Efficient Task Autonomous Planning Method for Small Satellites
## 3 Methods
### Algorithm Design
#### 3.2.3 Cross and Mutation Operator  
The crossover and mutation operator are used to optimize the initial population in order to generate individuals with higher fitness. According to the time constraints and resource constraints, we classify the individuals and analyze the possibility of increasing task profit, respectively, to guide the evolution of individuals. We can get \(W\) and \(R\) through time constraints and resource constraints, respectively. The resource constraint checking is based on time constraint checking, thus the following conclusions can be drawn:  
\[W=W|R \tag{8}\]  
\[R=W\&R \tag{9}\]  
For example, the time window sequence of an individual is as follows:  
\[Genome=[2,\ 1,\ 3,\ 4,\ 5]\ M=5\]  
\(W\) is a \(M\)-dimensional vector, here is an example:  
\[W=[1,\ 1,\ 0,\ 1,\ 1]\ M=5\]  
If the \(i\)-th time window can meet the time constraint, \(W_{i}=1\), otherwise, \(W_{i}=0\); Therefore, according to the time constraints, the time window sequence that can be selected is \(\{Win_{2},Win_{1},Win_{4},Win_{5}\}\). \(R\) is a \(M\)-dimensional vector, here is an example:  
\[R=[0,\ 1,\ 0,\ 1,\ 1]\ M=5\]  
If the task of the \(i\)-th time window can meet the resource constraint, \(R_{i}=1\), otherwise, \(R_{i}=0\). Therefore, according to the resource constraints, the time window sequence that can be selected is \(\{Win_{1},Win_{4},Win_{5}\}\). We divide the individuals into two categories according to the point of view of whether \(W\) and \(R\) are equal. If \(W\) is equal to \(R\), it indicates that all of the tasks that meet the time constraints are allocated to the required resources. Because of the small possibility of resources being used up, it can be considered that when \(W\) equals \(R\), there are resources that are left. Obviously, if the number of tasks satisfying the time constraints can be increased, it is possible to obtain more profitable individuals. In this case, there are also two states that can be subdivided according to whether the genome of an individual can fully meet the time-partially ordering constraint. When the genome is not fully satisfied with the time partially order constraint, increasing the number of time windows that meet the time partially order constraint may result in more individuals with high returns. We call this state an under partially ordering state. Here is an example of time partially order constraints, the relationship of the 10 time windows along the timeline is shown in Figure 6.  
_Win_ represents the set of time windows, \(win_{i}=[ws_{i},we_{i}]\), \(win_{j}=\big{[}ws_{j},we_{j}\big{]}\). If \(we_{i}\leq ws_{j}\), and \(win_{i}\
eq win_{j}\), then \(win_{i}\prec win_{j}\). We call it a time partially order constraint. Taking \(win_{5}\) as an example, the time windows that satisfy the time partially order constraint of \(win_{5}\) is: \(win_{1}\prec win_{5}\), \(win_{2}\prec win_{5}\), \(win_{5}\prec win_{8}\), \(win_{5}\prec win_{10}\). If two time windows do not satisfy Equations (10) and (11), we have defined that the two windows interact with each other, that is, \(win_{i}\) interact with \(win_{j}\). \[we_{i}<ws_{j} \tag{10}\]  
\[we_{j}<ws_{i} \tag{11}\]  
We define \(Inwin_{i}\) as the influence set of \(win_{i}\). \(Inwin_{i}=\big{\{}win_{j}\in Win\big{|}win_{i}\text{ }interact\ \ win_{j}\big{\}}\). Let the time windows in the genome all meet the time constraints, that is \(win_{1}\prec win_{2}\prec win_{3}\prec\ldots\prec win_{N}\). If a genome \(G_{0}=\)[6, 1, 3, 4, 2, 7, 5, 9, 8, 10], according to the time constraint check rules, the selected genes are [1, 2, 5, 8, 10]. In order to improve the degree of the time partially order constraint, we propose a partially ordering mutation operator (TPOMO). The aim of TPOMO is to keep the original sequence of genes as long as possible, and to adjust the sequence of genes so that the new genome can meet the time partially order constraint. The steps of TPOMO are shown as follows:  
* Step 1: Obtain an individual that is in line with this evolutionary direction.