# Evolutionary Statistical System Based on Novelty Search:
## 3 Novelty-Based Approach for the Optimization Stage in a Wildfire Prediction System
### Novelty-Based Genetic Algorithm with Multiple Solutions
For the tournament phase, a set of individuals is chosen to enter the mating pool, where a percentage of these are the ones with the highest novelty, while the rest are randomly chosen. This proportion is set by the tournament probability, \(\mathit{tour\_prob}\). The crossover rate is determined by \(\mathit{cr}\); this is the probability that two individuals from the current population are combined. In the current version, we have set this value to one, but it can be anywhere in the range \([0,1]\). Then, a proportion of the offspring is mutated according to \(\mathit{mut\_prob}\). The next step is the fitness computation represented by lines 8 to 10. Each individual computation is performed in evaluateFitness by the Worker processes, and the distribution of individuals to each Worker is managed by the Master. The fitness is calculated for all individuals in two steps: first, a simulation is carried out by the fire simulator; then, the fitness is computed with Equation (3). The fitness values are needed both for recording the best solutions in \(\mathit{bestSet}\) and for the computation of each individual's novelty score from Equation (1). Since the fitness scores of multiple neighboring scenarios are required for the computation of the novelty score, a second loop is needed (lines 12 to 14). Internally, evaluateNovelty compares the individual \(\mathit{ind}\) with each of the individuals in the reference set \(noveltySet\) using the measure \(dist\) and then takes the \(k\) nearest neighbors, i.e., those individuals \(ind^{\prime}\in noveltySet\) for which the smallest values of \(dist(ind,ind^{\prime})\) are obtained, and uses them to evaluate the novelty function according to Equation (1), where \(dist\) is computed by Equation (2). After the novelty computation loop, the next two lines are the ones that define the search to be driven by the novelty score. In line 15, updateArchive modifies the archive of novel solutions so that it is updated with the descendants that have higher novelty values. In other words, the replacement strategy is elitist based on the whole population: it considers the union of the sets _offspring_ and _archive_, and the \(N\) individuals with the highest novelty in this union are assigned to the _archive_. Population replacement is performed in replaceByNovelty (line 16), also using the elitist novelty criterion. Then, the function updateBest in line 17 modifies \(bestSet\) in order to incorporate the solutions in _offspring_ that have obtained better fitness values. In this case, the strategy is also elitist but based on fitness. In the first iteration, we start with an empty _archive_ and \(bestSet\), and therefore, in lines 15 and 17, we begin by assigning the complete _offspring_ set to both sets. For the first version, we have implemented a fixed size archive and solution set, but these sizes can potentially be parameterized or even designed to dynamically change size during the search. Lastly, the algorithm ends the current generation by updating the values for verifying the stopping conditions. In line 18, getMaxFitness returns the maximum value of fitness from the set passed as argument; this value corresponds to the maximum fitness that has been found during the search until the current moment. Line 19 updates the evolutionary generation number. These two values will be verified in line 6 during the next iteration. Once one of these conditions is met, the algorithm will return \(bestSet\), a collection of the best solutions obtained throughout the search.