CS 448 GA -- due 11/11/11!
Assignment
Complete your implementation of a genetic algorithm. Paste your prototype classes into here or
this slightly improved version (or, if you like my classes better, feel free to use them). Then,
behave like a scientist/researcher and explore the space of possible GAs to try to discover what it takes to make the algorithm work well. I.e. experiment with different parameter settings and
different fitness functions to determine combinations that lead to efficiently optimizing the various functions.
Details
Assuming you have use my prototype (but feel free to paste your own into the provided code) here's
how to proceed:
- Implement mutation
- Make selectMatingPool select the first two individuals, and replace the last two with the
mutated clones. Make sure you see the mutations.
- Add code to report the best individual and the average fitness
- Run several generations; you should expect the average fitness to rise
- Implement crossover
- Compare the performance of your algorithm with various population sizes on the ONES, and FOUR
fitness functions (see line 42 of the FitnessEvaluator to set the fitness function -- or... line 19 of GARunner if you are using the slightlyImproved version).
- Write the real selectMatingPool and replace code. Test it with small populations on ONES, then FOUR, then VEHICLES
Now that you have a working program, experiment with each fitness function to find the best values for population size, mutation rate, and crossover function are. Use the
following values to start, then, if you wish, try to find better yourself:
- Population size: 10, 100, 1000, 10000
- Mutation rate (per bit): 0.001, 0.01, 0.1
- Crossover: single point, 2-point, n-point, never (! - the never version is the headless chicken).
Like in the perceptron experiment, automatically generate a table so you can easily see trends. Make your own decisions about what tables to produce.
Extra credit
- Implement a bit-climber (as described in class). Compare it's performance (in CPU time, or number of fitness evaluations to find the maximum value), with the GA on the three fitness functions.
- Implement your own fitness funtions that reveal other characteristics of the various versions of a GA
How to get credit
Demo your program and email me:
- The zipped code
- A short description of "compared to what" -- i.e. what method you used to compare various GAs
- A short description of the best values to use for the various fitness funtions.
Include an explanation of *why* those values work well.
- What took the most time in doing this lab