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?