How can I use Parallel computing to run multi-objective ga ?
조회 수: 6 (최근 30일)
이전 댓글 표시
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
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
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!