Using SGA-C from the class directory ~shartley/MCS770, maximize the function

f(x1,x2) = 21.5 + x1 * sin(4*pi*x1) + x2 * sin(20*pi*x2)

over the range -3.0 to 12.1 for x1 and 4.1 to 5.8 for x2.

Use a 30 bit encoding for each of the variables x1 and x2, that is, the total chromosome length will be 60 bits. You will have to think carefully about your encoding scheme since x1 can take on negative values!

Use the stub app_report() to print out the floating point values of (x1,x2) for the best fit chromosome.

For comparison, try simple_ga_prog from the class directory on the same problem. Remember that each chromosome gene in SGA-C is a bit, whereas in simple_ga_prog each gene is a real number.

For both programs, vary the population size, the crossover probability, and the mutation probability to see what works best.

This programming assignment is due in class Monday, April 22, 1996.

There are three things to turn in electronically using the submit command:

  1. A listing of your objective (fitness) function from the SGA-C and simple_ga_prog source code, plus any other procedures or code you change.
  2. A listing of your best runs of SGA-C and simple_ga_prog. DO NOT include all generations! Use the script command and then edit out all but the first few, a middle few, and the last few generations.
  3. A write-up answering these questions describing how you optimized the function using genetic algorithms and what you learned (about one single-spaced page), and what problems you encountered while designing, implementing, and debugging your program and how you solved those problems. Be sure to compare the performance of SGA-C and simple_ga_prog on the function.
  4. Your write-up should clearly describe your encoding scheme, fitness function, crossover operators tried, mutation operators tried, and parameters that led to successful runs (population size, crossover and mutation probabilities).

Use the submit command to turn in file copies of all of the above. Place them in the Pr2 directory of MCS770. No more laserprinter and paper!