gamultiobj failure when starting with a whole feasible population
Show older comments
Hello, I am using gamultiobj of Matlab R2016b only with non-linear constraints. If I try to start the optimisation with a specified initial population which has all the individual feasible, I get the following error:
Assignment has more non-singleton rhs dimensions than non-singleton subscripts
Error in objAndConVectorizer (line 33)
Fvals(i,:) = feval(objFcn,(pop(i,:)));
Error in gamultiobjMakeState (line 118)
[~,C,Ceq,isFeas] =
objAndConVectorizer(state.Population(1:initScoreProvided,:), ...
Error in gamultiobjsolve (line 8)
state =
gamultiobjMakeState(GenomeLength,FitnessFcn,ConstrFcn,output.problemtype,options);
Error in gamultiobj (line 274)
[x,fval,exitFlag,output,population,scores] = gamultiobjsolve(FitnessFcn,nvars,
...
Caused by:
Failure in user-supplied fitness function evaluation. Cannot continue.
Instead, if I choose only the first individual of my initial population such that it is infeasible, the optimisation runs with no problem (thus fitness function has no problem). Unfortunately this is an issue when I want to start a new optimisation using the last population of the previous run, to keep on iterating, because I am forced to drop a good individual and to replace the first entry of the population with an infeasible element. If I do not use non-linear constraint, this problem does not occur, even this the error attributes the failure to the fitness function. I have been using a variety of fitness and non-linear constraint functions and I have had this error in all the cases. The way I call the optimiser is standard:
[x,fval,exitflag,output,population,score] = ...
gamultiobj(@FitnessFun,nvars,[],[],[],[],lb,ub,@ConstraintFun,options);
Thanks for help
Accepted Answer
More Answers (0)
Categories
Find more on Solver Outputs and Iterative Display 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!