# Comparison of Heuristic Algorithms in Discrete Search and Surveillance Tasks Using Aerial Swarms
## 3 Proposed Search Algorithm, a Set of Behaviors: A1
### Configuration of the Algorithm  
As we have shown, the algorithm consists of six different behaviors with a total of 23 parameters to be selected. Moreover, the optimum values of these parameters presumably depend on the scenario, i.e., on the values of the variables shown in Table 1. To solve this optimization problem, the following procedure was carried out.  
Given any plain scenario \(i\) (the scenario shown in Figure 2a) defined by the tuple \(\mathrm{Y}_{i}=\{A_{s}/N_{a},N_{a},v_{n},R_{f},f_{A}\}_{i}\), the algorithm parameters must be configured accordantly to achieve an appropriate performance. If we have a big-enough dataset of \(i=1,...,N\) scenarios with \(N\) suboptimal configurations \(\Omega_{i}^{*}\), i.e., with \(N\) suboptimal values for each of the 23 parameters of the algorithm, we can model them individually as a function of the scenario, using Y as predictors. As a result, for any scenario \(\mathrm{Y}_{j}\), a suboptimal estimation \(\hat{\Omega}_{j}\) is obtained, and the algorithm can then configured. The model selected to predict the suboptimal values is a Gaussian process (see [27]). To generate the dataset of suboptimal configurations, a genetic algorithm is used, whose main characteristics are:  
* Chain of genes: a vector made up by the 23 parameters of the algorithm. Each of the genes is normalized with a range of possible values.
* Population: 100 members.
* Initial population: Half of the initial population is taken from the two closest scenarios already optimized, 25 from each one. To select those members, a trade-off between fitness and genetic diversity is considered. The other half is taken as a prediction of the model. Since the model is probabilistic, these 50 member are drawn from the normal distribution of the Gaussian process.
* Fitness function: To evaluate each member, Equation (14) is used. In order to measure the noise due to the variability of the initial conditions, each member is tested 100 times.  
* Crossover: The members will be combined using the roulette-wheel technique, with a probability proportional to the fitness value. Two pairs made up by the same two members is forbidden. Two members being selected for the crossover, a new member will be created by applying a weighted sum of each gene individually. The weighting coefficient is a random number between zero and one. The offspring is made up of 50 new individuals.
* Next generation selection: After evaluating the new individuals, elitism is used to select the 100 best members for the next generation from the 150 available members.
* Stopping criteria: The optimization is stopped when one of these criteria is met:
* Maximum number of generations (30) has been reached.
* Maximum time for each optimization (24 h) has been reached.
* Maximum number of generations (10) without an improvement higher than 10% of the best member has been reached.
* Maximum number of generations (3) without an improvement higher than 10% of the mean fitness of the population has been reached.  
Having obtained \(k<N\) suboptimal configurations for \(k\) scenarios, the next scenario \(k+1\) is obtained so that the mean uncertainty of the GPs of the 23 parameters is most reduced, i.e., the scenario with the highest uncertainty is selected. A total of \(N=100\) scenarios is optimized and used as the dataset. In Figure 7, the complete modeling process has been schematically depicted.