How can I use Parallel computing to run multi-objective ga ?

12 ビュー (過去 30 日間)
Reem Digna
Reem Digna 2017 年 5 月 16 日
回答済み: Xiatong Cai 2018 年 12 月 19 日
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 件のコメント
Reem Digna
Reem Digna 2017 年 5 月 17 日
編集済み: Reem Digna 2017 年 5 月 17 日
yes, ENileSimulation is supplied by me. Optimization was running well before trying to use parallel computing but slow(takes 6 weeks). The above error appeared when tried to use parallel computing. The message is about the dimension that should be one. Is it because of multi-objective nature of the system I am using?
Walter Roberson
Walter Roberson 2017 年 5 月 17 日
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.

サインインしてコメントする。

回答 (1 件)

Xiatong Cai
Xiatong Cai 2018 年 12 月 19 日
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.

カテゴリ

Help Center および File ExchangeMultiobjective Optimization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by