CS 448 Prototype for a GA -- due 11/1/11.

Assignment

Implement a minimal prototype for a genetic algorithm. Write prototype classes for Individual, and Population.

You will recall that a genetic algorithm has a population of individuals (each with a chromosome of L bits, which encodes a strategy for dealing with some problem).

Details

For each class you must have:
  1. the important variables
  2. accessors for same
  3. a constructor, (Population's should initialize the population at random)
  4. public String toString(), which prints the values of all the variables

Include (and test) public Object clone() for Individual (don't forget to say implements Cloneable!)

At the application level, create and display a Population, each time the user pushes the Do a Generation Button, do one generation, executing the stubs of evaluateFitness, selectMatingPool, applyGeneticOperators, and replacement, then display the population -- yes, use a small population size!

That's it for the minimal prototype... but... if you have a little more time...

Next make selectMatingPool select the first two individuals, and implement mutation, and replace the last two with the mutated clones. Make sure you see the mutations.

Next implement the count 1s fitness function and make sure the fitnesses are calculated and change correctly (oh, that means you should fill in evaluateFitness to do that)