0
votes

I was wondering if there is a simple way to return additional values from a fitness function (in addition to the objective value) when using an optimisation algorithm, such as genetic algorithm or multi-objective ga in matlab?

For example, it is easy enough to specify additional parameters to be passed to a fitness function using a function handle:

f = @(x)parameterfun(x,a,b,c);

However, it doesn't say, as far as I am aware whether it is possible to do this for the output of the fitness function.

Some ideas I had include saving the values in the fitness-function to a file, and then reading them in the parent function, or saving the values as global variables, but these both seem a bit messy.

Any suggestions?

1
Are you using any framework or you are just wandering with your own code? - zegkljan

1 Answers

0
votes

The only thing that comes in my mind now is by saving a mat file inside the fitness function. You need to create a unique mat name each time however. One solution is creating a name based on the variables that enter the fitness function each time. Output functions might also be what you need http://www.mathworks.com/help/gads/genetic-algorithm-options.html#f17837