Example #17 and adding Biased Crossover

----- By John Escobar & Tom Kiehl

Example #17 uses a 2DArrayAlleleGenome with 3 alleles and uses the GA to create an array with alternating 0's and 1's with -1 at the corners.

Our primary concern was not with the content of the arrays but more with how crossover occured. We wanted to bias the crossover so that it never divided the X-axis up. Our reasons for doing this is because in our larger project we will have to limit crossover in the same way.

Figure 1 shows how example 17 originally performed crossover. We took the crossover function and redefined it so that it would perform crossover in the way that we wanted as seen in Figure 2.


Figure 1

Figure 2


In this particular example, changing how crossover occurs slightly lowered the fitness of the developing gene pool. As shown in Figure 3.


Figure 3


How we actually changed the code.


Things we learned and took from this example and others:


Modified Source Code:


Back to GA Page