I am using GA optimization tool but while simulation ran i is not terminating even introduced stopping criteria
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
Alan Weiss
am 17 Jan. 2022
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
Antworten (1)
Matt J
am 13 Jan. 2022
The "options" variable that you've created is never used. You did not pass it to ga().
2 Kommentare
Siehe auch
Kategorien
Mehr zu Genetic Algorithm finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!