Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
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 comentario
Alan Weiss
Alan Weiss el 17 de En. de 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

Iniciar sesión para comentar.

Respuestas (1)

Matt J
Matt J el 13 de En. de 2022
The "options" variable that you've created is never used. You did not pass it to ga().

Categorías

Más información sobre Genetic Algorithm en Help Center y File Exchange.

Productos


Versión

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by