GAMULTIOBJ function does not take into account the upper bound (ub)
1 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
I am designing an Genetic Algorythm for which the genes of the population must be between the values 0 and 150. For thius purpose, I have established the lower bound (lb) and the upper bound (ub) to 0 and 150 respectively as it can be seen in the code below.
for i=1:numberOfVariables
lb(i)= 0; % lower bound of the genes
ub(i)= 150; % upper bound of the genes
end
% Inequality restrictions definition
A = []; b = []; % without inequality restrictions
Aeq = []; beq = [];
% GAMULTIOBJ solver execution
options = gaoptimset('PlotFcns',[]);
options = gaoptimset(options,'PopulationSize',numPop);
options = gaoptimset(options,'PopInitRange',[(-1);(1)]);
options = gaoptimset(options,'CrossoverFcn',@crossoverheuristic);
options = gaoptimset(options,'MutationFcn',@mutationadaptfeasible);
options = gaoptimset(options,'TimeLimit',tm);
options = gaoptimset(options,'Generations',numGenerations);
[x,Fval,exitFlag,Output] = gamultiobj (FitnessFunction,...
numberOfVariables,A,b,Aeq,beq,lb,ub,options);
Every time I execute the code, I have observed that the genes of the population values are between 0 and around 1.2 (it rarely exceeds 1 in any value) as it can be seen in the image below.
If I have delimited the boundaries between 0 and 150 I do not understand why the obtained values are only between 0 and 1.2.
This is not supposed to happen, is it? What am I doing wrong? Why does this happen? How can I solve this?
Thanks a lot.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genomics and Next Generation Sequencing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!