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().

类别

Help CenterFile Exchange 中查找有关 Genetic Algorithm 的更多信息

产品


版本

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by