Is it possible to make create custom InitialPopulation for N simulation iterates of genetic algorithm w/o resetting optimoptions N times?
Show older comments
I would like to use the genetic algorithm to simulate N nonlinear minimization problems with nonlinear constraints. As the problem is constrained, I get better results when I am able to feed the genetic algorithm a custom creation function/initial population. Is there a way to create N custom subpopulations without resetting optimoptions N times?
Further background/context: I had hoped to use the custom creation function to index the evaluation of the creation function to the particular simulation iteration of the objective function; i.e., on simulation j = 542 of 2,000,000, call a creation functio that accepts the index j as a variable so that the created index j facilitates the creation of a new initial population, something like the following:
function Population = myfun(K,obj2,options,START,ilb,iub,j,G)
Population = (repmat(ilb(j,:),G,1)+repmat(iub(j,:)-ilb(j,:),G,1).*START);
where iub, ilb are custom bounds for each simulation iterate j, G the populzation size, K the dimension of a population member, and START a G-by-K matrix of preallocated uniform random variables.
Thus far, I haven't had any luck. Using the the for-loop index j is no good, as creating a function handle for the creation function freezes the for-loop index at whatever variable existed at the time the handle was created. Additionally, one cannot seemingly make the for-loop index a variable of the creation function, as the genetic algorithm seems to only know how to call on creation functions with the variables (GenomeLength, FitnessFcn, options). I would appreciate any insight available on this matter.
Accepted Answer
More Answers (0)
Categories
Find more on Genetic Algorithm in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!