필터 지우기
필터 지우기

GAMULTIOBJ function does not take into account the upper bound (ub)

조회 수: 1 (최근 30일)
Haritz Odriozola Olalde
Haritz Odriozola Olalde 2021년 7월 29일
편집: Haritz Odriozola Olalde 2021년 7월 29일
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개)

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by