gamultiobj constraints without any mathematical relation with variables
1 回表示 (過去 30 日間)
古いコメントを表示
Hi everyone, I am carrying out Multi-objective design optimisation using gamultiobj of Global Optimization Toolbox, is there any way to stop the optimiser from computing the result (or to not consider that pearticular iteration) for a partcular iteration after performing a part of the code and fulfilling certain conditions?
For example, My fitness function is like this,
............................
..............code involving calcuating the area using some external software
area = extractBetween(lines_2(12),7,13);
area_number = str2num(area);
...........
y(1) = 1/max_l_d;
y(2) = overpressure;
END OF FITNESS FUNCTION
Now, I just want the optimiser to stop a particular iteration when area_number > 150 m^2. Also, this area is not directly mathematically related to the variables(else I would have used nonlcon or linear constraints), its calculation is done from some external software and we will not be getting this value until a part of fitness function code is executed, for every iteration. SO, hence the question is that it needs to stop executing that particular iteration when this condition is fulfilled.
0 件のコメント
回答 (1 件)
Torsten
2022 年 12 月 6 日
Use an output function "OutputFcn" specified in the options structure of the solver.
Within this function, you can calculate "area_number" and decide how to proceed further.
From the documentation:
OutputFcn
Functions that ga calls at each iteration. Specify as a function handle or a cell array of function handles. See Output Function Options.
For an options structure, use OutputFcns.
Function handle or cell array of function handles | {[]}
3 件のコメント
Torsten
2022 年 12 月 8 日
As to my knowledge, you can do both in the OutputFunction: write out the iterates and stop the optimization.
参考
カテゴリ
Help Center および File Exchange で Genetic Algorithm についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!