GAmultiobj optimisation boxdirections error

Hi everyone,
when using he GAmultiobj algorithm for my problem i get the following error
PS:i'm using a population of 20 with 50 generation and 7 optimisation variable, when the error occurs the MeshSize=[]
Error using /
Matrix dimensions must agree.
Error in boxdirections (line 22)
pollParam = 1/sqrt(MeshSize);

8 Comments

We need to see the inputs you give gamultiobj and your option settings, something like [x,fv] = gamultiobj(stuff we need to see). You might also try using the debugger.
Alan Weiss
MATLAB mathematical toolbox documentation
Hi Mr Alan!
i was using this function call
lb=[25 5 82 240 78 0.001 5 ];
ub=[38 10 150 300 100 0.0044 15 ];%---->metre
nvars=7;
% EliteCount_Data=4;
% MigrationInterval_Data=3;
PopulationSize_Data=50;
MaxGenerations_Data=20;
[x,fval,exitflag,output,population,score] = multi_objective_genetic_algorithm_solver(nvars,lb,ub,PopulationSize_Data,MaxGenerations_Data,EliteCount_Data,MigrationInterval_Data);
and now i'm trying this one and waiting for the results
lb=[25 5 82 240 78 0.001 5 ];
ub=[38 10 150 300 100 0.0044 15 ];%---->metre
nvars=7;
EliteCount_Data=4;
MigrationInterval_Data=3;
PopulationSize_Data=5;
MaxGenerations_Data=5;
[x,fval,exitflag,output,population,score] = multi_objective_genetic_algorithm_solver(nvars,lb,ub,PopulationSize_Data,MaxGenerations_Data,EliteCount_Data,MigrationInterval_Data);
This does not look like a call to gamultiobj, unless your multi_objective_genetic_algorithm_solver function calls gamultiobj internally. I don't think that anyone will be able to help you unless you show us what your code is doing.
Also, if you are using migration, then you have not read the description of migration options, which clearly states that there is no benefit to using these options.
Alan Weiss
MATLAB mathematical toolbox documentation
@Alan Weiss exatly sir!
here is the multi_objective_genetic_algorithm_solver script
function [x,fval,exitflag,output,population,score] = multi_objective_genetic_algorithm_solver(nvars,lb,ub,PopulationSize_Data,MaxGenerations_Data)
options = optimoptions('gamultiobj');
%% Modify options setting
options = optimoptions(options,'PopulationSize', PopulationSize_Data);
options = optimoptions(options,'MaxGenerations', MaxGenerations_Data);
options = optimoptions(options,'Display', 'off');
options = optimoptions(options,'OutputFcn',@myoutputfcn);
global outputFcn_global_data
[x,fval,exitflag,output,population,score] = ...
gamultiobj(@code,nvars,[],[],[],[],lb,ub,@const,options);
global Resultats
Rereading this thread, I am struck that I didn't question you earlier on the solver you are using. It looks to me as if the error comes from patternsearch or paretosearch, not gamultiobj.
Can you please report all of the error text that you get, everything in red?
Alan Weiss
MATLAB mathematical toolbox documentation
Right away!
Error using /
Matrix dimensions must agree.
Error in boxdirections (line 22)
pollParam = 1/sqrt(MeshSize);
Error in mutationadaptfeasible (line 72)
[Basis,TangentCone] = boxdirections(true,StepSize,x,linCon.lb,linCon.ub,tol);
Error in stepgamultiobj (line 38)
mutateKids = feval(options.MutationFcn,parents((1 + 2 * nXoverKids):end),options,GenomeLength, ...
Error in gamultiobjsolve (line 55)
state = stepgamultiobj(pop,thisPopulation,options,state, ...
Error in gamultiobj (line 304)
[x,fval,exitFlag,output,population,scores] = gamultiobjsolve(FitnessFcn,nvars, ...
Error in multi_objective_genetic_algorithm_solver (line 12)
gamultiobj(@code,nvars,[],[],[],[],lb,ub,@const,options);
Error in Main (line 13)
[x,fval,exitflag,output,population,score] =
multi_objective_genetic_algorithm_solver(nvars,lb,ub,PopulationSize_Data,MaxGenerations_Data);
I do not understand how this can happen. You say "when the error occurs the MeshSize=[]". My reading of the code indicates that the mesh size should always be a strictly positive number, never zero or empty.
I wonder if this is somehow related to your placing gamultiobj inside of another function call. What happens if you call gamultiobj directly on your problem? I mean, set up the problem variables and call gamultiobj manually, not within another function. Do you get the same error? If so, what are the inputs to gamultiobj?
Alan Weiss
MATLAB mathematical toolbox documentation
i'll try and comeback to you

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!