resuming and starting from new line in genetic algorithm after specific generations

조회 수: 2 (최근 30일)
Hamid
Hamid 2014년 11월 5일
댓글: Hamid 2014년 11월 14일
Hi,
I want to resume and start from new line in genetic algorithm after specific generations.
Has anyone know How is impossible??
Any suggestion may help a lot.
Thank you guys.
  댓글 수: 7
Hamid
Hamid 2014년 11월 9일
편집: Hamid 2014년 11월 9일
I want to change f-matrix every 100 generations and I'm partly sure that a solution better happen at the end of generation 700, beside I don't have another choice and I have to inject all these 7 conditions.
for example : nn=20 nb=4 nl=6
case 1 (0-100 generations) : f(13)=800 f(14)=0 f(15)=-1000 and so on
case 2 (101-200 generations) : f(13)=0 f(14)=700 f(15)=-500 and so on
also I used 5 for an experiment and the right one is 700 generations.
Thank you very much Geoff for helping me.
Hamid
Hamid 2014년 11월 9일
Dear Geoff - my final goal is to reaching to best solution under all 7 conditions together, these conditions only difference in f-matrix.
What do you recommend?????
I'm so confused and I'm gonna be crazy.

댓글을 달려면 로그인하십시오.

답변 (1개)

Geoff Hayes
Geoff Hayes 2014년 11월 10일
Hamid - I don't think that I can give a valid recommendation because I don't know enough of what you are trying to do. f seems to be a matrix used in the fitness function, but I can't guess as to its impact or that of changing a handful of its values. But if you want to try and re-use the population after 100 iterations with a slight change to the f matrix, then you could change your return from the ga function of
[x,fval]=ga(@(x) penalty2(x,available,bc,Dof,E...),Nvars,options);
to
[x,fval,exitflag,output,population] = ga(@(x)penalty2(x,available,bc,Dof, E...),Nvars,options);
The population output parameter will be the final population for (say) 100 iterations of the algorithm. You then update the f matrix, and re-call
% re-use the population as the initial population for the next 100 generations
options = gaoptimset('InitialPopulation', population);
% run the algorithm
[x,fval,exitflag,output,population] = ga(@(x)penalty2(x,available,bc,Dof, E...),Nvars,options);
for 100 more generations. Then change f to whatever you want. You can put this in a loop that iterates from 1 through to 7, and you would change f on each iteration.
However, this method may not work as expected especially if the GA has converged to a premature solution before generation 100. If all members of the population are identical (or near-identical) then there will not be enough genetic diversity in the next round of 100 generations to produce any new members even though you have changed the f matrix.
  댓글 수: 19
Geoff Hayes
Geoff Hayes 2014년 11월 14일
Hamid - you will have to work backwards from the above in order to determine what the problem is. Consider how nevt and neft are initialized and/or updated.
Hamid
Hamid 2014년 11월 14일
Ok I will try my best.
Thank you very much.

댓글을 달려면 로그인하십시오.

카테고리

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