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

12 visualizaciones (últimos 30 días)
Reem Digna
Reem Digna el 16 de Mayo de 2017
Respondida: Xiatong Cai el 19 de Dic. de 2018
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 comentarios
Reem Digna
Reem Digna el 17 de Mayo de 2017
Editada: Reem Digna el 17 de Mayo de 2017
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 el 17 de Mayo de 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.

Iniciar sesión para comentar.

Respuestas (1)

Xiatong Cai
Xiatong Cai el 19 de Dic. de 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.

Categorías

Más información sobre Multiobjective Optimization en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by