?? multidepintegergaussmutation.m
字號:
function [parent] = multiDepIntegerGaussMutation(parent,bounds,Ops)% The Gaussian mutation mutates the parameter with the probablity% of a normal Gaussian distibution. If the new value is not within% the given bounds, another value is picked. If the maximim number% of retries is exceeded, the parent is returned.%% function [newSol] = multiDepIntegerGaussMutation(parent,bounds,Ops)% parent - the first parent ( [solution string function value] )% bounds - the bounds matrix for the solution space% Ops - Options for multiDepIntegerGaussMutation % [gen stdDev/boundaryDelta numRetries]% By Kerry W. Lothrop <kerry@lothrop.de>%% Lothrop, K.W.: Conceptual Design Optimization of a Cis-Lunar% Transportation Architecture Using Genetic Algorithms, Universit鋞% Stuttgart, University of Colorado, 2003%% This program is free software; you can redistribute it and/or modify% it under the terms of the GNU General Public License as published by% the Free Software Foundation; either version 1, or (at your option)% any later version.%% This program is distributed in the hope that it will be useful,% but WITHOUT ANY WARRANTY; without even the implied warranty of% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the% GNU General Public License for more details. A copy of the GNU % General Public License can be obtained from the % Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.cg=Ops(1); % Current Generationsd=Ops(2); % The standard deviation of the Gauss function % 1 = width of variable rangenr=Ops(3); % maximum number of retriesdf = bounds(2) - bounds(1); % Range of the variabledevfac = df * sd / 2; % deviation factorfor tr = 1:nr nv = round(parent + randn * devfac); if nv > bounds(1) & nv < bounds(2) parent = nv; return; endend% no result: return parent
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -