How to Add Fitness Limit as Stopping Criterion in Genetic Algorithm?
7 ビュー (過去 30 日間)
古いコメントを表示
I added fitness limit into field 'options' in genetic algorithm code and defined its value to be 0.5.
clc
clear all
global x1e x2e x3e x1r x2r x3r alfa12 alfa13 alfa23
%LLE podatci - ekstrakcija aromata smjesom TTEG i vode - 6 komponenata (heptan) na 60°C
%eksperimentalni podatci - ekstrakt
x1e = [0.0140 0.0175 0.0163 0.0188 0.0181 0.0227 0.0228 0.0214 0.0191 0.0208];
x2e = [0.0729 0.0696 0.106 0.1041 0.1107 0.0931 0.0732 0.0739 0.113 0.069];
x3e = 1 - x1e - x2e;
%eksperimentalni podatci - rafinat
x1r = [0.689 0.6289 0.485 0.4727 0.4332 0.6831 0.6967 0.6553 0.4507 0.6139];
x2r = [0.275 0.2855 0.4418 0.3501 0.4056 0.313 0.2716 0.271 0.4436 0.253];
x3r = 1 - x1r - x2r;
%Optimizacija NRTL parametara - Metoda Sorensena i Arlta
%1. stupanj optimizacije - opis fazne ravnoteze - geneticki algoritam
%parametri neslucajnosti
alfa12 = 0.3;
alfa13 = 0.3;
alfa23 = 0.2;
rng default
%definiranje strukture problema
OF_A = @OF_2_6H_60C;
problem.fitnessfcn = OF_A;
problem.nvars = 6;
problem.options = optimoptions('ga','FitnessLimit',0.5);
[x,fval] = ga(problem)
However, after running code I get following result:
Optimization terminated: average change in the fitness value less than options.FunctionTolerance.
x =
6.1833 5.3657 2.3855 0.6108 2.6711 2.4970
fval =
0.9834
Matlab used function tolerance (default setting) as stopping criterion and not fitness limit even though I added FitnessLimit in field options. Why is this?
0 件のコメント
採用された回答
Geoff Hayes
2022 年 1 月 26 日
@Dario Miric - from Stopping Conditions for GA, it mentions that for all of the different stopping conditions, the algorithm stops as soon as any one of these conditions is met. In your case, it seems that the FunctionTolerance condition is being met before the FitnessLimit. For the function tolerance, it also mentions that the algorithm runs until the average relative change in the fitness function value over MaxStallGenerations is less than Function tolerance. You could try increasing the MaxStallGenerations but this won't gurantee that the FitnessLimit will be used to stop the algorithm.
2 件のコメント
Alan Weiss
2022 年 1 月 27 日
I would like to point out that you set a fitness limit of 0.5, and the final reported value of the fitness function was 0.98, which is well above the fitness limit. That is why ga did not stop. If you would set a fitness limit above the value 1, ga would stop based on hitting that limit.
Alan Weiss
MATLAB mathematical toolbox documentation
その他の回答 (0 件)
参考
カテゴリ
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!