• No results found

A genetic algorithm is a method that may be used to solve unconstrained or constrained optimi- sation problems. The solution methodology was inspired by Darwin’s theory of evolution [124], or more specifically, the key mechanism of evolution — natural selection.

This metaheuristic begins with a set of solutions which is collectively referred to as a population. The algorithm functions by modifying individual solutions from the current population and uses them as parents to produce children for the next generation. The parent solutions contribute their genes (the values of the decision variable vector) to their children. Generally, the algorithm selects parents that have better fitness values when forming the next generation — similar to the notion of natural selection where only the strongest individuals survive.

The genetic algorithm implemented in this thesis creates three types of children namely, elite children, crossover children and mutated children. The underlying mechanisms whereby these children are created are illustrated in Figure 6.1. Elite children are the candidate solutions with the best fitness values. These solutions are carried over to the next generation without any changes to the individuals. Crossover children, on the other hand, are created by combining certain segments of the binary decision variable vector from a pair of parents. Lastly, mutation children are created by introducing random changes (mutations) to a single parent. These mutations are achieved by inverting certain values at random positions of the binary decision variable vector.

6.3. Genetic Algorithmic Implementation 107

(a) Elite child (b) Crossover child (c) Mutation child

Figure 6.1: Three types of children used to populate the next generation in the generic algorithm.

In the search space, the notion of elite children allows the algorithm to focus on areas in the search space which contain good solutions, whereas the incorporation of crossover combines the genes of parents in the hope of obtaining potentially superior children. To ensure that the algorithm does not converge prematurely to a weak local optimum, mutation adds diversity to the population, thereby improving the thoroughness of the search and increasing the chances of finding a global optimum. Matlab utilises the so-called MI-LXPM real-coded genetic algorithm developed by Deep et al. [50] for solving integer problems. The reader is referred to [50] for a detailed description of the use of the crossover and mutation parameters. The selection process of a new generation is outlined follows:

1. A fitness score of each of the members of the current population is determined in order to rank them.

2. This raw fitness score is then scaled in order to convert it to a usable range of values for the purposes of selecting parents from whom children are produced.

3. The number of elite children is specified by the user. The top n solutions (where n is the specified elite number), based on fitness score value, are directly passed over to the next generation.

4. The number of elite children is subtracted from the initial population size. This new population size is used to determine the number of crossover children required, which is specified in terms of a percentage of this new population size.

5. After generating the crossover children, the rest of the population is filled by generating mutation children.

6. This new population of children then forms the next generation. Infeasible solutions are penalised by employing a penalising function and may therefore form part of the next generation, but are relatively unlikely to be selected for crossover (compared to feasible solutions).

The extent to which the mechanisms depicted in Figure 6.1 are utilised to form new populations, is a very important, problem-specific consideration. Careful consideration of these parameters is therefore crucial to ensure that good solutions are obtained in a limited time frame.

In order to determine a good combination of these genetic algorithm parameters, an experiment was conducted to determine the sensitivity of the simulation outcome with respect to the afore- mentioned population parameters. Since there are an infinite number of possibilities, a decision had to be made regarding the selection of a few parameter value combinations which could then be tested further.

Since the implemented simulation needs to adapt to changing scenarios, such as changes in the problem scale, it was decided to select the population size as a function of the number of decision variables. A larger population will generally improve solution accuracy, but increase computational time up to a certain point which depends on the problem structure [165]. It was therefore decided to select a population size that is sufficiently large. After testing various combinations, and gaining some intuition in respect of their effects on the speed and quality of solutions, the population size P is represented as

P =kxk × 1.2 ,

where kxk denotes the number of decision variables which, in turn, is the product of the number of threats, WSs and the length of the forecasting timeframe. The population size is therefore effectively 20% more than the number of decision variables.

Based on an analysis by Mathworks [126], a crossover percentage of 80–90% seems suitable for the majority of problem types. It was therefore decided to test crossover percentages of 80% and 90%. The elite count was taken as a default value of 10% of the population, but it was decided to test the effect that increasing and decreasing the elite-count has on the solution quality. Three different elite-count values were therefore tested — 5%, 10% and 15% of the population. The different combinations of population parameter values considered are listed in Table 6.1.

Table 6.1: Different tested combinations of the genetic algorithm population parameter values.

Elite count Crossover %

Combo 1 d0.05 × Pe 80 Combo 2 d0.10 × Pe 80 Combo 3 d0.15 × Pe 80 Combo 4 d0.05 × Pe 90 Combo 5 d0.10 × Pe 90 Combo 6 d0.15 × Pe 90

In order to assess the performance of these different population selection parameter value com- binations, the dynamic WA problem was solved separately for these combinations in the context of the scenario introduced in §4.6. The outcomes of 30 scenario runs — and more specifically how early threats were successfully engaged — was used as the main performance criterion for this test. It was not possible to use the fitness function value for this purpose, since the problem changes continuously from one simulation run to the next because of all the stochastic elements. It would therefore be intractable to compare the fitness value for different simulation runs. The problem was solved for each iteration and the results used as inputs for the next computation cycle, as described in §6.4.1. The results of the analysis are visualised by the box-and-whisker plots in Figure 6.2.

From the plots in Figure 6.2 it is clear that there is a large variability in the results. This variability may be attributed to all the stochastic elements in the simulation — the random spheres for the generation of flight paths, the heuristic WA algorithm and — probably the largest contributor — the SSHP values of the WS-threat combinations. The outcome of each engagement was determined according to a uniform random distribution, as explained in§4.2.3. All these stochastic elements collectively contribute to the variability of the simulation results. It is possible that the simulation results are therefore, in fact, less sensitive to small changes in the genetic algorithm population selection parameters.

Combo 2 in Table 6.1 achieves the smallest spread when compared to the other combinations, for all the threats. Also, combo 2 generally achieves the earliest successful engagement for the

6.3. Genetic Algorithmic Implementation 109

Combo 1 Combo 2 Combo 3 Combo 4 Combo 5 Combo 6 10 20 30 40 50 60 70 80 90 100 TEW A cycle numb er during which threat w as eliminated (a) Threat 1

Combo 1 Combo 2 Combo 3 Combo 4 Combo 5 Combo 6 10 20 30 40 50 60 70 80 90 100 TEW A cycle numb er during which threat w as eliminated (b) Threat 2

Combo 1 Combo 2 Combo 3 Combo 4 Combo 5 Combo 6 10 20 30 40 50 60 70 80 90 100 TEW A cycle numb er during which threat w as eliminated (c) Threat 3

Figure 6.2: Box-and-whisker plot comparison of the different population generation parameter combi- nations for each threat. The horizontal axes denote the combination of parameters indicated in Table 3, while the vertical axes denote the time-interval during which the threat was successfully engaged and, correspondingly, destroyed.

three threats. There is, however, not enough information available to ascertain with confidence that combination two is, indeed, always better than the alternatives. For this thesis, however, combo 2 was used in order to illustrate the functioning of the different algorithms and is deemed an adequate combination of parameter values for a proof of concept study such as this where the end goal is to illustrate the working of the TEWA algorithms of Chapter 5.

Furthermore, it is possible, since a relatively large population is used in the genetic algorithm, that the solution quality is less dependent on the other population parameters. If a smaller population is selected in order to adhere to restrictions placed on computational time, new population parameters will have to be selected. The ideal combination of these parameters is very problem-specific (i.e. the particular objective function and constraints adopted) and also depends on the instance size of the specific problem (i.e. the number of WS, threats and the forecasting time length) that has to be solved. If a metaheuristic is used to solve the WA problem in real-time, the properties of the metaheuristic should be tailored to the specific problem instance, and even updated in real time.