How can I use Parallel computing to run multi-objective ga ?
12 views (last 30 days)
Show older comments
Hello, I am using multi-objective ga to maximize the return of water allocated for hydropower and irrigation. There are two objective functions and 1932 decision variables.
I tried to use parallel computation by clicking on " Start parallel pool" and adding
options = gaoptimset(options,'UseParallel', true);
to the code after .
I got the following error:
Error using ENileSimulation (line 64)
Size can only have one unknown dimension.
Error in ENileNLGAconstraints (line 10)
[~,~,~, WBC]= ENSimulation(newrIR);
Error in objAndConVectorizer (line 37)
parfor (i = 1:popSize)
Error in gamultiobjMakeState (line 83)
[Score,C,Ceq,isFeas] =
objAndConVectorizer(state.Population(initScoreProvided+1:end,:), ...
Error in gamultiobjsolve (line 8)
state =
gamultiobjMakeState(GenomeLength,FitnessFcn,ConstrFcn,output.problemtype,options);
Error in gamultiobj (line 276)
[x,fval,exitFlag,output,population,scores] = gamultiobjsolve(FitnessFcn,nvars, ...
Error in OptimizationCode (line 73)
gamultiobj(@ENobjfun,nvars,[],[],[],[],lb,ub,@ENNLGAconstraints,options);
Caused by:
Failure in user-supplied fitness function evaluation. Cannot continue.
3 Comments
Walter Roberson
on 17 May 2017
We have no idea why ENileSimulation is saying that "Size can only have one unknown dimension." because we have no idea what the contents of ENobjfun or deeper routines are.
That error message can occur if you have a reshape() in which you have more than one [] such as
reshape(A, [], 17, [])
However, we have no access to your code to see why it is doing a reshape at all, let alone what parameters it is passing.
Answers (1)
Xiatong Cai
on 19 Dec 2018
Hello,
Usually the problem is because in your setting, the vectorization which is selected as true. So you can use command ('UseVectorized', false) in the options to solve this problem.
0 Comments
See Also
Categories
Find more on Multiobjective Optimization in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!