Saving intermediate population during GA
4 次查看(过去 30 天)
显示 更早的评论
I need some help to find out a way to store the information related to every generation of the GA
(both the variable and the fitness values)
It could be both on an external file ( e.g. in a .txt file) or in a struct array.
Which one do you suggest? And how can I do it?
Thanks in advance
0 个评论
采纳的回答
Alan Weiss
2013-4-18
You can save whatever you like using an output function. For examples of output functions (using a different syntax, be careful, GA uses its own), see a MATLAB example, and an Optimization Toolbox example.
Alan Weiss
MATLAB mathematical toolbox documentation
2 个评论
yusra asad
2018-12-8
It seems that the example gives only the values of the variables, I need the corresponding fval for each indiviual, did you get it?
更多回答(1 个)
Daniel Frisch
2020-10-7
You can use my function
outputFcn_global
to store all intermediate results in a global variable, and easily inspect them later on.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!