ВУЗ: Не указан
Категория: Не указан
Дисциплина: Не указана
Добавлен: 13.06.2025
Просмотров: 4185
Скачиваний: 0
Genetic Operators
21.3 Genetic Operators
Similar to the genetic algorithm operators in Chapter 20, we have crossover and mutation. However, here they are applied directly to a Lisp program.
Crossover Crossover (sexual recombination) operation for genetic programming recreates the diversity in the evolved population by combining program parts from two individuals:
1.Select two parent individuals from the current generation based on their fitness values.
2.Randomly determine a crossover point in each of the two parents. Both crossover points must match, i.e. they must both represent either a value or a statement.
3.Create the first offspring by using parent no. 1, replacing the sub-tree under its crossover point by the sub-tree under the crossover point from parent no. 2. Create the second offspring the same way, starting with parent no. 2.
Since we require the selected crossover points to match type, we have guaranteed that the two generated offspring programs will be valid and executable.
Crossover points can be external (a leaf node, i.e. replacing an atom) or internal (an internal tree node, i.e. replacing a function). External points may extend the program structure by increasing its depth. This occurs when one parent has selected an external point, and the other has selected an internal point for crossing over. An internal point represents a possibly substantial alteration of the program structure and therefore maintains the variety within the population.
if |
if |
|||||||||||
obj_ |
< |
obj_ |
< |
right |
||||||||
20 |
left |
right |
20 |
prog |
||||||||
pos |
pos |
|||||||||||
while |
right |
strai. |
||||||||||
< |
||||||||||||
psd |
while |
|||||||||||
20 |
prog |
|||||||||||
front |
psd |
< |
||||||||||
right |
strai. |
20 |
left |
|||||||||
front |
||||||||||||
Figure 21.2: Crossover
313