フィルターのクリア

Genetic algorithm initial popuplation

2 ビュー (過去 30 日間)
dimitris
dimitris 2013 年 3 月 3 日
I use GA to minimize an objective function with 20 variables. I noticed that ga always produces initial population with small distance between individuals, usually at [0,1] while lower bound is 0 and upper bound is 90. I would like ga to produce the initial population more uniformly. Is this possible? My code:
n=20;
A=zeros(n,n); %linear constraint x1<=x2<=x3<=x4<=...<=x20
b=zeros(n,1);
for i = 1:n
for j = 1:n
if(i+j==n+1)
A(i,j)=-1;
end
if(i+j==n)
A(i,j)=1;
end
end
end
b(n)=90;
LB=zeros(n,1);
UB=90*ones(n,1);
options=gaoptimset('creationfcn',@gacreationuniform,'PlotFcns',{@gaplotbestf,@gaplotscores,@gaplotbestindiv,@gaplotdistance},'Display','iter');
[x,fval,exitflag,output,final_pop]=ga(@(x) obj(x),n,A,b,[],[],LB,UB,[],options)

回答 (2 件)

Matt J
Matt J 2013 年 3 月 3 日
use gaoptimset to control the Population options as you please

Alan Weiss
Alan Weiss 2013 年 3 月 4 日
I believe you need to set your PopInitRange option. See this example.
Alan Weiss
MATLAB mathematical toolbox documentation

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by