|
Assignment 1 (getting a feel for local search and landscapes) |
120 points |
|
DUE: Fri Sep 19 at 5pm PST |
This assignment is a good warmup.
Write a simple local search.
152 23 0.997067 3.000978 0.999990
For the experiments, you will run essentially the same program except for the different mutation operators and genotype to phenotype mappings. You will turn in your code and a report on what you find. More on the report in a moment. When you turn in your code you will need code for each of the four experiments and a single makefile (I will supply a sample makefile below).
Then in the next three experiments compare them to this one.
[Hint: here is a possible declartion for a mutation function:
unsigned int mutate(unsigned int chromosome, int size);]
This program shall be named localBit. (note what is capitalized and what is not) For the first experiment, create a mutation operator that randomly flips exactly one bit in the chromosome that represents the current best fitness. It is important that you are always mutating the last best chromosome and not the last chromosome that failed. Why? The geneotype/phenotype mapping is as described above. Run this 20 times with different random seeds. What do you observe? Explain it. Be clear and concise. Show your data/results.
This program shall be named localInc. For this experiment use a mutation operator that either increments or decrements the field of 10 bits with x in it or with y it. That is four possible mutations. This must be done very carefully since the field must wrap within each 10 bit field and not carry over into the adjacent field. Run this 20 times with different random seeds and report what you observe. Be clear and concise. Show your data/results and compare.
This program shall be named localGray. For this experiment go back to the random bit flip mutation operator of experiment 1. This time alter the fitness function to use the bitDegray function from the bit utilities provided below to degray the 10 bit x and y strings before you map them to reals. This will treat your space as if it is in gray code. Run this 20 times with different random seeds and report what you observe. Compare your observations with the previous two experiments and the control.
make localRand make localBit make localInc make localGrayto build the four experiments. Your code should take no parameters but run simply by executing localRand, localBit, localInc or localGray to see the results of one run up to 10000 evaluations.
Your report should be in a pdf file named exactly report.pdf. It should say:
I will grade this based first be seeing that your code compilers, runs and returns a sensible answer. I will read the report to make sure it is clear and that you understand what happened when you ran the experiments. 50% of your score on each part. Your report needs to be concise and to the point. Make your points about each experiment and what you learned from that experiment.
| Robert Heckendorn | Last updated: |