Error using genetic algorithim
3 views (last 30 days)
Show older comments
Hi there,
I am trying to minimise a funciton using the 'genetic algorithm', the function takes some time to evaluate and I am trying to make things faster by means of parallelising. However, I don't get the hang of it completelly, particularly I don't understand why after 600 hundred iterations of the algorithm, the command window throws the following error:
Error using fcnvectorizer (line 16)
The source code (C:\Program Files\MATLAB\R2020b\toolbox\globaloptim\globaloptim\private\fcnvectorizer.m) for the
parfor-loop that is trying to execute on the worker could not be found.
Error in stepGA (line 61)
nextScore = fcnvectorizer(pop,FitnessFcn,1,options.SerialUserFcn);
Error in galincon (line 67)
[score,population,state] = stepGA(score,population,options,state,GenomeLength,FitnessFcn);
Error in ga (line 402)
[x,fval,exitFlag,output,population,scores] = galincon(FitnessFcn,nvars, ...
Error in CA_MW_E2E (line 82)
param_hat = ga(@(x)
SMM_obj_func(param,mmts,'param_est',x,'parnames',estpar_names,'num_sim',num_sim),length(estpar_names),[],[],[],[],lb,ub,[],options_ga);
Caused by:
Undefined function 'G_w_inv_gip' for input arguments of type 'double'.
Error using remoteParallelFunction (line 84)
Worker unable to find file.
Undefined function 'G_w_inv_gip' for input arguments of type 'double'.
Failure in user-supplied fitness function evaluation. GA cannot continue.
The function 'G_w_inv_gip' is created by me and it's a gridded interpolant.
I would appreciate if somebody could help me know if the problem with this piece of programe has to be with the genetic algorithm (since the worker does not find the file) or with my function 'G_w_inv_gip'.
I will be looking to your askers.
KR
0 Comments
Answers (1)
Yi Zhao
on 18 Apr 2022
Hello,
Have you solved this problem? I have encountered similar problems. Can you share your solutions?
Thank you
0 Comments
See Also
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!