Currently, I have a genetic algorithm defined by the following lines of code:
>> opts = optimoptions(@ga,'PopulationSize', PopulationSize,... 'MaxGenerations', MaxGenerations,'EliteCount', 1,... 'OutputFcns', @my_view,'PlotFcn', @gaplotbestindiv); >> [x, fval,output] = ga(@Costfunction,9,[], [], [], [],... lb, ub, @Constraints, [1:5], opts)
In my ConstraintFunction, I want to run an external simulation. For better performance of the external simulation, it would be nice to get the full set of one generation first. Therefore, I would like to obtain a full population set for the first generation of my genetic algorithm to be used in an external simulation.
Best Answer