?? children.m
字號:
function childs = children(parent,method,pmut)% CHILDREN - Creates the children from the parentpool% % c=children(parent,'method',pmut) The function returns a% vector with the children created from the supplied matrix of% parents. The methods allowed is described below, the argument% 'pmut' is the probability of mutation. % % 'uform' - uniform crossover% 'npoint' - n points crossover a number with the desired% points. NOT IMPLEMENTED YET% % See also PARENTS,UI_MUTATE,MUTATEind=1;switch method case 'uform' [m n]=size(parent); for k=1:m c1=parent(k,1)+parent(k,2); c1=morph(c1,parent(k,2),pmut); childs(ind)=c1; ind=ind+1; c2=parent(k,2)+parent(k,1); c2=morph(c2,parent(k,1),pmut); childs(ind)=c2; ind=ind+1; end otherwiseend
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -