GA generates duplicate initial populations

I am using Genetic Algorithms for inverse problems (a large number of variables, i.e. more than 1000). I use the supercomputers provided by my university to run my models. In order to check how efficient my GA model is, I need to run one model a couple of times (e.g. 10 times) and see how many times it converges to an acceptable solution. The problem is that for all the trials of a specific model, Matlab generates exactly the same set of initial populations. This rsults in exactly the same answers for all the trials. I manually generated initial populations to overcome this issue, however, the model did not converge to a solution since it was very complicated and manually generated initial populations did not lead to convergence. In the model, I have upper and lower bounds without any constraint. Is it possible for Matlab to generate timely randomised initial populations (automatically by Matlab through options maybe, not by manually defining initial populations)? This will help with generating different initial populations for different runs of the same model. Your help is much appreciated.

2 comentarios

infinity
infinity el 20 de Jun. de 2019
Hello,
You can look at this
rng('shuffle')
Twana Haji
Twana Haji el 20 de Jun. de 2019
Editada: Twana Haji el 21 de Jun. de 2019
Hi,
Many thanks for your reply. The command rng('shuffle') works perfectly. Thank you very much.

Iniciar sesión para comentar.

 Respuesta aceptada

Twana Haji
Twana Haji el 21 de Jun. de 2019
Editada: Twana Haji el 21 de Jun. de 2019

0 votos

The issue is related to the random number generation of MATLAB. Before writing GA sentences (e.g. options, ga() function, etc), the command rng('shuffle') has to be added to the code so that each time the code is run, a new initial population is randomly generated. For more information, visit the follwoing link. Trung VO DUY wrote this in comments for me - thank you Trung VO DUY.

Más respuestas (0)

Preguntada:

el 20 de Jun. de 2019

Editada:

el 21 de Jun. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by