why the penalty of ga, when all the population violates the nonlinear constraints, is smaller than the penalty of feasible populations?

2 visualizaciones (últimos 30 días)
I have integer problem with nonlinear constraints. So, at the beggining there are only few integer options (the problem's boundary increases through time) and sometimes all the populations my violate the non-linear constraint. For example, the penalityt value of the first generation with feasible population is 5, then ga assignes penality value 1 when the entire population in the second generation violates the non-linear constraint.
  4 comentarios
Matt J
Matt J el 17 de Nov. de 2022
Editada: Matt J el 17 de Nov. de 2022
How are you observing the population size? How are you observing the penalty values? What code can we run to illustrate what you are seeing?
Emebet Gedlu
Emebet Gedlu el 17 de Nov. de 2022
Well, I have a very complex problem but here is the idea.
f=@(n_Tx)CMPC_vector(n_Tx,u_past,decide,Setup,Hist_temp, plan_OP,trainedNet,Rem_step);
nonlcon=@(x)MaxTorqueLim(x,Setup,Rem_step,decide);
options=optimoptions('ga', 'Display', 'iter','MaxTime',120,...
'PopulationSize',PP_Size,'UseVectorized',true,...
'CrossoverFraction',0.5,'EliteCount',floor(1+PP_Size/3),'MaxStallGenerations',15);
[n_Tx_float,f_val]=ga(f,Setup.NInput*Rem_step,[],[],[],[],lb,ub,nonlcon,1:Setup.NInput*Rem_step,options);
function JJ= CMPC_vector(x,u_past,decide,Setup,Hist, plan_OP,trainedNet,Rem_step)
...
end
I just put a brake point in the first line of the "CMPC_vector" function to obesrve what is in x. Then I give higher penality value if it is empy, but what appear in the display is just 1 all way till the maximum stall.

Iniciar sesión para comentar.

Respuestas (1)

Jasvin
Jasvin el 21 de Sept. de 2023
Hi Emebet,
So, this is a problem that exists with all optimization algorithms in MATLAB. The following MATLAB Answers post would help you gain more insight into what is happening and provide helpful links:
Hope this helps!

Categorías

Más información sobre Get Started with Optimization Toolbox 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