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

1 次查看(过去 30 天)
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 个评论
Matt J
Matt J 2022-11-17
编辑:Matt J 2022-11-17
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 2022-11-17
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.

请先登录,再进行评论。

回答(1 个)

Jasvin
Jasvin 2023-9-21
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!

类别

Help CenterFile Exchange 中查找有关 Get Started with Optimization Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by