How to use the Genetic Algorithm with the Parallel Computing Toolbox MATLAB2014b

I usually used MATLAB2009b,but now I want to use the Genetic Algorithm with the Parallel Computing Toolbox of MATLAB2014b.There are too much changes between these,so I want to know how to use the toolbox now.

4 Comments

What specifically are you trying to do? Is there a function or a simple piece of code that you ran in R2009b that you cannot run in R2014b?
The attached file is source code.The code that I ran in R2009b that I cannot run in R2014b is
distributedFitnessFcn = @(x)cell2mat(dfeval(FitnessFcn,distributionpopulation(x,nTasks),...
'Configuration','local', 'FileDependencies', FileDeps));
and
[x,fval,reason,output]=ga(distributedFitnessFcn,nvars,options);
Thank you for your help.
What problem do you encounter in R2014b? I get an "unknown function" for distributionpopulation. Is it the batch command you're having trouble with? You appear to be calling it with a function as the first argument, which means that the second argument should be the number of output arguments requested. The 'Configuration' parameter should be 'Profile', and the 'FileDependencies' should be 'AttachedFiles' - perhaps that might help.
I have fixed the problem you mentioned, but the error remains.
My aim is to use GA in several cores by Genetic Algorithm with the Parallell Computing Toolbox of R2014b.
The attached file is distributionpopulation.m which I used in Genetic Algorithm with the Parallel Computing Toolbox of R2009b(the distributionpopulation.m is one of the Built-in files in gads toolbox of R2009b ). You can check it. It worked well until I update my MATLAB to R2014b. The error message is that the parameters in all dimentions should be greater than zero and it prompts that
"Failiure in initial user-supplied fitness function evaluation and GA can not continue."

Sign in to comment.

Answers (0)

Asked:

on 5 Oct 2015

Commented:

on 6 Oct 2015

Community Treasure Hunt

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

Start Hunting!