?? myga.m
字號:
warning off all
P1=xlsread('P1');
P2=xlsread('P2');
P3=xlsread('P3');
P=[P1 P2 P3];
I=xlsread('I');
bounds=[300];
NIND=10;
NVAR=50;
xFns='cyclicXover uniformXover partmapXover orderbasedXover singleptXover linerorderXover';
xOpts=[2; 2; 2; 2; 2; 2];
mFns='inversionMutation adjswapMutation shiftMutation swapMutation threeswapMutation';
mOpts=[2; 2; 2; 2; 2];
termFns='maxGenTerm';
termOps=[2000];
selectFn='normGeomSelect';
selectOps=[0.08];
evalFn='mygaEval';
evalOps=[];
gaOpts=[1e-6 1 1];
[startPop,weights,y0]=mygaini(NIND,bounds,NVAR,'mygaEval',P,I,[],[1e-6 1]);
[x,endPop,bestPop,trace,weigths]=ga1(bounds,P,I,NVAR,y0,evalFn,evalOps,startPop,gaOpts,...
termFns,termOps,selectFn,selectOps,xFns,xOpts,mFns,mOpts);
bestPop;
trace;
plot(trace(:,1),trace(:,2));
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -