Nonlinear inequality in GA optimization with integer constraints
1 回表示 (過去 30 日間)
古いコメントを表示
Hi, I am using GA optimization tool. The problem I am solving contains integer constraints (IntCon), but I need to set a non-linear inequality to the objective function. I am calculating the value of the function (k-eff) for patterns obtained from the genetic algorithm, but I need an inequality for the power, which must be kept below a certain value (power <= 1.3). What I consulted is that the inequalities [c, ceq] are set in the following way c(x) <= 0, so c(x) -1.3 <= 0. On the other hand for the problem with IntCon the ceq = [ ].
Thanks in advance.
2 件のコメント
Alan Weiss
2020 年 10 月 20 日
And what is the question? You stated some correct restrictions on c and ceq. But I don't understand what you want from us.
Alan Weiss
MATLAB mathematical toolbox documentation
回答 (1 件)
Matt J
2020 年 10 月 20 日
編集済み: Matt J
2020 年 10 月 20 日
In the code you have shown for POWER_CONSTRAINT(~), it does not make sense that POWER does not depend on the input, but rather on some independent .txt file. The point of the nonlinear constraint function is that it lets ga() query the feasibility of an input x. If the text file is supposed to have some dependence on x, then there should be code within POWER_CONSTRAINT(x) that regenerates POWER_PEAK.txt for the input x.
If the issue is that POWER_PEAK.txt is a heavy computation and you are trying to avoid repeating a computation that may have been already done elsewhere in your code, then read here:
2 件のコメント
Matt J
2020 年 10 月 20 日
編集済み: Matt J
2020 年 10 月 20 日
with this value I run an external simualtion code for the objective function evaluation.
You are assuming though that the x that is passed to your constraint function will be the same as the x that ga() most recently passed to the objective function. Because that assumption is not always valid, however, your constraint function will sometimes need to re-run the simulation for the x that it receives as input. The link I gave you discusses how to implement that efficiently.
There is no way to check if you are using that function?
We don't have to check because it can be seen in your code that you are not using it. The input to POWER_CONSTRAINT is completely ignored.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!