From where does the Genetic Algorithm take the values of variables in optimisation process?

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.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!