How to show initial population in Genetic Algorithm
조회 수: 1 (최근 30일)
이전 댓글 표시
Dear all
I like to show initial population for each generation from given codes below. Normally, GA generate a uniform random number for initital population. My expectation is show full initial population for each generation. Let's given that my populationsize is 100 and i have 10 time of generations. I only could see a final matrix initial population for only 1 generation (i think this is the best genetic found from GA) when GA completed its run. I am not sure if i am missing a loop for initial population? Does anyone could help me? Thank you.
fitnessFunction = @myfunc;
nvars = 24 ;
Aineq = [];
Bineq = [];
Aeq = [];
Beq = [];
bound=load('...limitdata.txt');
LB(1:12)=bound(2,1:12);
LB(13:24)=bound(2,13:24);
UB(1:12)=bound(1,1:12);
UB(13:24)=bound(1,13:24);
nonlconFunction = [];
options = gaoptimset;
options = gaoptimset(options,'SelectionFcn' ,@selectionroulette);
options = gaoptimset(options,'PopulationSize' ,100);
options = gaoptimset(options,'Generations' ,10);
options = gaoptimset(options,'PlotFcns' ,{ @gaplotbestf @gaplotbestindiv @gaplotdistance @gaplotexpectation });
[X,FVAL,REASON,OUTPUT,POPULATION,SCORES] = ga(fitnessFunction,nvars,Aineq,Bineq,Aeq,Beq,LB,UB,nonlconFunction,options);
댓글 수: 0
답변 (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!