CROSSOVER OPERATOR

In this example, there is one crossover_point, and the Crossover command has randomly chosen 3 to be that crossover_point. For Child1, genes 1-3 are donated by Parent1, and genes 4-7 are donated by Parent2. For Child2, genes 1-3 are donated by Parent2, and genes 4-7 are donate by Parent1. This way of alternating the donating parent for each subgroup of genes helps to create offspring that take on characteristics of both their parents.

Parent1 Genome
|
Eat_G
Up_G
Down_G
|
Left_G
Right_G
Horizevad_G
Vertevad_G
11
22
33
|
44
55
66
77
|
Parent2 Genome
|
Eat_G
Up_G
Down_G
|
Left_G
Right_G
Horizevad_G
Vertevad_G
19
28
37
|
46
54
63
72
|
|
from Parent1
|
from Parent2
<-------
|
------->
Child1 Genome
|
Eat_G
Up_G
Down_G
|
Left_G
Right_G
Horizevad_G
Vertevad_G
11
22
33
|
46
54
63
72
|
from Parent2
|
from Parent1
<-------
|
------->
Child2 Genome
|
Eat_G
Up_G
Down_G
|
Left_G
Right_G
Horizevad_G
Vertevad_G
19
28
37
|
44
55
66
77