Assignment 'Function Minimisation with Genetic Algorithms'
This assignment lets you use a basic form of genetic algorithms to minimise
a function f: R -> R. You should have completed the
`GA Getting Started' exercise first.
You should use this exercise to investigate the performance of your Genetic Algorithm and this should be included in your final report.
Problem specification
- The galib software is designed to maximise the
objective function.
Think of a suitable choice for the objective
function here.
-
Start the implementation by creating a new file FunMinProblem.h.
Decide on which subclass of Chromosome you need here (What is the
search space?)
-
The function evaluateObjective should evaluate the objective function
for a given value of x (represented by a Chromosome object).
Implement this function.
- An example function that has many local minima is:
f(x) = 200 sin(x) + x2
Try to minimise this function on a subdomain, e.g., [-20,30].
Visualisation
- Make sure there is a line
1 #print info to file?
in the parameter file genetic.input.
-
Next, create a new MATLAB function plotobjectives(filename, nrmembers)
that reads the written file, reshapes it such that each generation is on a row,
all members' objective values in a column. Let it plot one graph with three
lines for the maximum, minimum and average value throughout all generations.
Improve the Algorithm
At the moment the galib software does not optimise the population at all.
Start working on mutation (Ex. 4.4), followed by roulette wheel selection
and crossover (Ex. 4.5) to improve this.