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