Clear Filters
Clear Filters

Issues with running genetic algorithm (GA) in parallel computation

9 views (last 30 days)
Hello,
opts = optimoptions(@ga, ...
'PopulationSize', 10, ...
'MaxGenerations', 50, ...
'EliteCount', 1, ...
'FunctionTolerance', 1e-5, ...
'PlotFcn', @gaplotbestf, ...
'UseParallel',true) ;
[xbestDisc, fbestDisc, exitflag, output, population, scores] = ga(@FCWithDisc,6, A, b, [], [], lb, ub, [], 1:6, opts);
Im trying to use genetic algorithm (GA) to optimize a question with 6 varuables, and use Parallel computing to improve the GA efficiency. However, at the beginning of calculation, errors appear as follows:
Error using fcnvectorizer (line 16)
The source code (D:\Program Files\MATLAB\R2021a\toolbox\globaloptim\globaloptim\private\fcnvectorizer.m) for the
parfor-loop that is trying to execute on the worker could not be found.
Error gaminlppenaltyfcn
Error gapenalty
Error makeState (line 69)
Score = FitnessFcn(state.Population(initScoreProvided+1:end,:));
Error galincon (line 22)
state = makeState(GenomeLength,FitnessFcn,Iterate,output.problemtype,options);
Error gapenalty
Error gaminlp
Error ga (line 394)
[x,fval,exitFlag,output,population,scores] = gaminlp(FitnessFcn,nvars, ...
.........
I would appreciate if somebody could help me.
Yi

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!