In the genetic algorithm optimisation process, from where does the GA take initial values for the variables?
function y = simple_fitness(x) y = 100 * (x(1)^2 – x(2)) ^2 + (1 – x(1))^2;
FitnessFunction = @simple_fitness; numberOfVariables = 2; [x,fval] = ga(FitnessFunction,numberOfVariables)
In this script, we have not defined the values for x(1) and x(2) to start the optimisation process. However, the script is executed and we get the answer.
Best Answer