Читать книгу Power Magnetic Devices - Scott D. Sudhoff - Страница 22
Example 1.5B
ОглавлениеLet us consider the crossover, segregation, and mutation processes on a numerical example. Figure 1.9 illustrates these operators. Therein g1 − g4 denote genes 1–genes 4 and c1 and c2 denote chromosomes 1 and 2, respectively. We start at the left of the diagram with the two parents θp1 and θp2. The first operator applied is crossover. Assuming the crossover point is between the first and second bits in the first chromosome, and that no crossover occurs in the second chromosome, we arrive at θa1 and θa2. The portions of the genetic code which have been acted on by the crossover operator are shown in bold. Next, chromosome segregation occurs. In this case, by a random choice the first child inherits the first chromosome from θa2 and the second chromosome from θa1. The second child inherits the remaining chromosomes. Next, let us assume that mutation acts to change the status of the first bit of gene 3 in θb2. This yields θc1 and θc2, where the affected bit is again indicated in boldface.
At this point, the main points of a canonical GA have been described. This canonical form is the type of algorithm first developed by Holland. The canonical GA can also be used to explain the effectiveness of GAs using schema theory. A schema is a pattern of bits; one reason GAs are so effective is that they can be shown to exhibit an implicit parallelism in which all schema that result in higher than average fitness tend to propagate. The interested reader is referred to textbooks on GAs such as those by Goldberg [4,5].
Figure 1.9 Chromosome crossover, segregation, and mutation in Example 1.5B.
At this point, an example would prove useful. Before embarking on such an example, however, it will prove useful to address one weakness of the GA. This weakness is the encoding algorithm. Although the representation of a member of the population as a string similar to that in DNA is intellectually appealing, it is also inconvenient. Further, a binary representation of real numbers suffers from finite resolution and the fact that sometimes large numbers of bits may need to change to accomplish a small change unless, for example, a Gray code scheme is used. As it turns out, it is possible to create a GA without encoding genes as strings and, instead, representing them with real numbers. Real‐coded GAs are simpler to write than their canonical counterparts and very effective. They will be our next topic.