Next: Results
Up: BODY
Previous: Genetic Algorithm Background
The Genetic Algorithm is based off of Roulette random choosing, with two-point crossover, one-point crossover,
and one-to-one options for breeding. Mutation and elitism are also available. To do this,
create a function that accepts the arrays defined in the cellular automata. The user is given a choice
every rnu by means of text output/input when the genetic algorithm is begun. First, you define the
reproduction method for the subjects. There are many considerations in the reproductive method. Ideally,
you want to develop the subjects towards a better end. Therefore, you need to evaluate the subjects on a
fitness level and set their probability for reproduction based on their fitness level. To evaluate the
fitness of arrays in this particular problem, simply evaluate the last cell, which should have been defined
in the cellular automata as the fitness of the array. A common means of selecting which subjects will
reproduce is to set up a figurative roulette wheel, with a proportion of the wheel assigned to each subject
based upon their fitness level. Have a function that turns each fitness level into a percentage of the
entire fitness sum of every subject. Then, random numbers are generated in a seperate function (0-100)
and the subjects whose portions of the wheel the numbers relate to are selected to reproduce. Breeding
can be done in many ways. For breeding of two subjects together, you can divide the "chromosomes" at one
point and take half of each and splice them together. Use a random number generator to select a point at
random in the arrays and insert the first half of the first array into a new array, and the second half
of the second array into the new array. Also, it is common to divide the chromosomes at two points and
splice the genes together. This works by generating two random numbers, accepting the first and last third
(as defined by the random numbers) from the first array and the middle third from the second array. The
genes can be alternated at every point, or they can be randomly selected from one of the two at every
point. Alternation is implented fairly easily, but it is not too practical in developing better arrays.
To randomly select one at each point (more similar to real genetics), simply have a binary random number
generator that will govern from which array each cell will be taken and inserted into the new array.
There are also many extra features that are often included in a genetic algorithm. For instance, mutation
is fairly common. In every offspring, add a small but significant chance that genes will be randomly
altered. Another feature that can be used is elitism. Elitism ensures that the most fit subject in
each generation survives into the subsequent generation. Simply pass the entirety of the most fit array
(found through a simple search of fitness levels) to a child array.
However, my genetic algorithm is not currently compatiblen with my cellular automata. There is a problem
somewhere that is nearly impossible for me to debug. This will therefore cause problems in my analysis
and conclusions.
Next: Results
Up: BODY
Previous: Genetic Algorithm Background
Austin L. Rachlin
2003-06-12