Saving intermediate population during GA

조회 수: 4 (최근 30일)
andrea84
andrea84 2013년 4월 17일
답변: Daniel Frisch 2020년 10월 7일
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

채택된 답변

Alan Weiss
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
andrea84
andrea84 2013년 4월 18일
편집: andrea84 2013년 4월 18일
Reviewing the example gave me a clearer understanding of the problem.
Thank you!
yusra asad
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
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.

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by