I am using GA optimization tool but while simulation ran i is not terminating even introduced stopping criteria

1 回表示 (過去 30 日間)
I am using optmization tool in Matlab and using genetic algorithm. When i initiated the model to run, it starts running without giving an meesage error but the model is not terminating after more than 8 hr even i gave stopping criteria . The folowing code gets input from various functions. and script code to run genetic alogirithm is as follows:
A=zeros(12,24);
for i=1:12
A(i,i)=1;
A(i,i+12)=-1;
end
b=zeros(12,1);
options=gaoptimset
options.InitialPopulation=[420.300000000000;420.300000000000;420.300000000000;420.300000000000;472.400000000000;420.300000000000;420.300000000000;420.300000000000;420.300000000000;420.300000000000;420.300000000000;420.300000000000;472.400000000000;420.300000000000;420.300000000000;460;472.400000000000;472.400000000000;472.400000000000;472.400000000000;472.400000000000;472.400000000000;472.400000000000;472.400000000000]
options.TolFun=0.00001;
options.Vectorized=true;
Output=ga(@Trial,24,A,b,[],[],[420.3,420.3,420.3,420.3,420.3,420.3,420.3,420.3,420.3,420.3,420.3,420.3,420.3,420.3,420.3,420.3,420.3,420.3,420.3,420.3,420.3,420.3,420.3,420.3],[472.4,472.4,472.4,472.4,472.4,472.4,472.4,472.4,472.4,472.4,472.4,472.4,472.4,472.4,472.4,472.4,472.4,472.4,472.4,472.4,472.4,472.4,472.4,472.4])
Please suggest how may i improve it to terminate it.
Thanks
  1 件のコメント
Alan Weiss
Alan Weiss 2022 年 1 月 17 日
Without seeing your Trial objective function I am left to guess what is happening. I think that you should include a plot function, perhaps gaplotbestf, to observe what is happening.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

サインインしてコメントする。

回答 (1 件)

Matt J
Matt J 2022 年 1 月 13 日
The "options" variable that you've created is never used. You did not pass it to ga().
  2 件のコメント
Mohsin Munir
Mohsin Munir 2022 年 1 月 13 日
ok thank you. I will make changes accordingly and let you know the feedback
Mohsin Munir
Mohsin Munir 2022 年 1 月 16 日
Sorry sir the answer did not help me

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

製品


リリース

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by