Integer Test


The researcher used a very simple problem to debug the genetic algorithm to minimize the number of outside factors that could result in undesirable results such as improper selection of potential solution types, inadequate definition of the problem, and/or bugs in the environment or artificial intelligence type.

Gene type

In this case, the gene type was not complicated, but rather simply a six-digit array of integers. In other words, a number from zero to 999999. Cross breeding was performed by selecting the same random point for both parent strings and swapping all the genes from that point on as shown in the picture below.


Determination of fitness

The fitness of the array was simply the number it represented.

Genetic algorithm parameters

Cross breeding was performed on 70% of the population and straight breeding was performed on the remaining 30% of the population. The population size was 500 strings and each test processed 10 generations. The test was run 100 times.

Result

The average fitness of the random starting populations for all 100 runs was 555227 and the standard deviation of those means was 22077.7. The average fitness for all of the evolved populations was 975367 and the standard deviations of the means was 10481.7. Clearly, the genetic algorithm did produce populations of higher average fitness.