亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ga.m

?? A modified version of genetic algorithm (GA) which can keep a trace of each generation.
?? M
字號:
function [x,fval,exitFlag,output,population,scores] = ga(fun,nvars,Aineq,bineq,Aeq,beq,lb,ub,nonlcon,options)%GA    Constrained optimization using genetic algorithm.%   GA attempts to solve problems of the form:%       min F(X)  subject to:  A*X  <= B, Aeq*X  = Beq (linear constraints)%        X                     C(X) <= 0, Ceq(X) = 0 (nonlinear constraints)%                              LB <= X <= ub%%   X = GA(FITNESSFCN,NVARS) finds a local unconstrained minimum X to the%   FITNESSFCN using GA. NVARS is the dimension (number of design%   variables) of the FITNESSFCN. FITNESSFCN accepts a vector X of size%   1-by-NVARS, and returns a scalar evaluated at X.%%   X = GA(FITNESSFCN,NVARS,A,b) finds a local minimum X to the function%   FITNESSFCN, subject to the linear inequalities A*X <= B. Linear%   constraints are not satisfied when the PopulationType option is set to%   'bitString' or 'custom'. See the documentation for details.%%   X = GA(FITNESSFCN,NVARS,A,b,Aeq,beq) finds a local minimum X to the%   function FITNESSFCN, subject to the linear equalities Aeq*X = beq as%   well as A*X <= B. (Set A=[] and B=[] if no inequalities exist.) Linear%   constraints are not satisfied when the PopulationType option is set to%   'bitString' or 'custom'. See the documentation for details.%%   X = GA(FITNESSFCN,NVARS,A,b,Aeq,beq,lb,ub) defines a set of lower and%   upper bounds on the design variables, X, so that a solution is found in%   the range lb <= X <= ub. Use empty matrices for lb and ub if no bounds%   exist. Set lb(i) = -Inf if X(i) is unbounded below;  set ub(i) = Inf if%   X(i) is unbounded above. Linear constraints are not satisfied when the%   PopulationType option is set to 'bitString' or 'custom'. See the %   documentation for details.%%   X = GA(FITNESSFCN,NVARS,A,b,Aeq,beq,lb,ub,NONLCON) subjects the%   minimization to the constraints defined in NONLCON. The function%   NONLCON accepts X and returns the vectors C and Ceq, representing the%   nonlinear inequalities and equalities respectively. GA minimizes%   FITNESSFCN such that C(X)<=0 and Ceq(X)=0. (Set lb=[] and/or ub=[] if%   no bounds exist.) Nonlinear constraints are not satisfied when the%   PopulationType option is set to 'bitString' or 'custom'. See the %   documentation for details.%%   X = GA(FITNESSFCN,NVARS,A,b,Aeq,beq,lb,ub,NONLCON,options) minimizes%   with the default optimization parameters replaced by values in the%   structure OPTIONS. OPTIONS can be created with the GAOPTIMSET function.%   See GAOPTIMSET for details.%%   X = GA(PROBLEM) finds the minimum for PROBLEM. PROBLEM is a structure%   that has the following fields:%       fitnessfcn: <Fitness function>%            nvars: <Number of design variables>%            Aineq: <A matrix for inequality constraints>%            bineq: <b vector for inequality constraints>%              Aeq: <Aeq matrix for equality constraints>%              beq: <beq vector for equality constraints>%               lb: <Lower bound on X>%               ub: <Upper bound on X>%          nonlcon: <nonlinear constraint function>%          options: <Options structure created with GAOPTIMSET>%        randstate: <State of the uniform random number generator>%       randnstate: <State of the normal random number generator>%%   [X,FVAL] = GA(FITNESSFCN, ...) returns FVAL, the value of the fitness%   function FITNESSFCN at the solution X.%%   [X,FVAL,EXITFLAG] = GA(FITNESSFCN, ...) returns EXITFLAG which%   describes the exit condition of GA. Possible values of EXITFLAG and the%   corresponding exit conditions are%%     1 Average change in value of the fitness function over%        options.StallGenLimit generations less than options.TolFun and%        constraint violation less than options.TolCon.%     3 The value of the fitness function did not change in%        options.StallGenLimit generations and constraint violation less%        than options.TolCon.%     4 Magnitude of step smaller than machine precision and constraint%        violation less than options.TolCon. This exit condition applies%        only to nonlinear constraints.%     5 Fitness limit reached and constraint violation less than%        options.TolCon. %     0 Maximum number of generations exceeded.%    -1 Optimization terminated by the output or plot function.%    -2 No feasible point found.%    -4 Stall time limit exceeded.%    -5 Time limit exceeded.%%   [X,FVAL,EXITFLAG,OUTPUT] = GA(FITNESSFCN, ...) returns a%   structure OUTPUT with the following information:%            randstate: <State of the function RAND used before GA started>%           randnstate: <State of the function RANDN used before GA started>%          generations: <Total generations, excluding HybridFcn iterations>%            funccount: <Total function evaluations>%        maxconstraint: <Maximum constraint violation>, if any%              message: <GA termination message>%%   [X,FVAL,EXITFLAG,OUTPUT,POPULATION] = GA(FITNESSFCN, ...) returns the%   final POPULATION at termination.%%   [X,FVAL,EXITFLAG,OUTPUT,POPULATION,SCORES] = GA(FITNESSFCN, ...) returns%   the SCORES of the final POPULATION.%%%   Example:%     Unconstrained minimization of 'rastriginsfcn' fitness function of%     numberOfVariables = 2%      x = ga(@rastriginsfcn,2)%%     Display plotting functions while GA minimizes%      options = gaoptimset('PlotFcns',...%        {@gaplotbestf,@gaplotbestindiv,@gaplotexpectation,@gaplotstopping});%      [x,fval,exitflag,output] = ga(@rastriginsfcn,2,[],[],[],[],[],[],[],options)%%   An example with inequality constraints and lower bounds%    A = [1 1; -1 2; 2 1];  b = [2; 2; 3];  lb = zeros(2,1);%    % Use mutation function which can handle constraints%    options = gaoptimset('MutationFcn',@mutationadaptfeasible);%    [x,fval,exitflag] = ga(@lincontest6,2,A,b,[],[],lb,[],[],options);%%     FITNESSFCN can also be an anonymous function:%        x = ga(@(x) 3*sin(x(1))+exp(x(2)),2)%%   If FITNESSFCN or NONLCON are parameterized, you can use anonymous%   functions to capture the problem-dependent parameters. Suppose you want%   to minimize the fitness given in the function myfit, subject to the%   nonlinear constraint myconstr, where these two functions are%   parameterized by their second argument a1 and a2, respectively. Here%   myfit and myconstr are M-file functions such as%%        function f = myfit(x,a1)%        f = exp(x(1))*(4*x(1)^2 + 2*x(2)^2 + 4*x(1)*x(2) + 2*x(2) + a1);%%   and%%        function [c,ceq] = myconstr(x,a2)%        c = [1.5 + x(1)*x(2) - x(1) - x(2);%              -x(1)*x(2) - a2];%        % No nonlinear equality constraints:%         ceq = [];%%   To optimize for specific values of a1 and a2, first assign the values%   to these two parameters. Then create two one-argument anonymous%   functions that capture the values of a1 and a2, and call myfit and%   myconstr with two arguments. Finally, pass these anonymous functions to%   GA:%%     a1 = 1; a2 = 10; % define parameters first%     % Mutation function for constrained minimization%     options = gaoptimset('MutationFcn',@mutationadaptfeasible);%     x = ga(@(x)myfit(x,a1),2,[],[],[],[],[],[],@(x)myconstr(x,a2),options)%%   See also GAOPTIMSET, FITNESSFUNCTION, GAOUTPUTFCNTEMPLATE, PATTERNSEARCH, @.%   Copyright 2003-2008 The MathWorks, Inc.%   $Revision: 1.28.4.14.2.1 $  $Date: 2008/01/21 15:53:28 $% If the first arg is not a gaoptimset, then it's a fitness function followed by a genome% length. Here we make a gaoptimset from the args.defaultopt = struct('PopulationType', 'doubleVector', ...    'PopInitRange', [0;1], ...    'PopulationSize', 20, ...    'EliteCount', 2, ...    'CrossoverFraction', 0.8, ...    'MigrationDirection','forward', ...    'MigrationInterval',20, ...    'MigrationFraction',0.2, ...    'Generations', 100, ...    'TimeLimit', inf, ...    'FitnessLimit', -inf, ...    'StallGenLimit', 50, ...    'StallTimeLimit', inf, ...    'TolFun', 1e-6, ...    'TolCon', 1e-6, ...    'InitialPopulation',[], ...    'InitialScores', [], ...    'InitialPenalty', 10, ...    'PenaltyFactor', 100, ...    'PlotInterval',1, ...    'CreationFcn',@gacreationuniform, ...    'FitnessScalingFcn', @fitscalingrank, ...    'SelectionFcn', @selectionstochunif, ...    'CrossoverFcn',@crossoverscattered, ...    'MutationFcn',{{@mutationgaussian 1  1}}, ...    'HybridFcn',[], ...    'Display', 'final', ...    'PlotFcns', [], ...    'OutputFcns', [], ...    'Vectorized','off', ...    'UseParallel', 'never');% Check number of input argumentserrmsg = nargchk(1,10,nargin);if ~isempty(errmsg)    error('gads:ga:numberOfInputs',[errmsg,' GA requires at least 1 input argument.']);end% If just 'defaults' passed in, return the default options in Xif nargin == 1 && nargout <= 1 && isequal(fun,'defaults')    x = defaultopt;    returnendif nargin < 10,  options = [];    if nargin < 9,  nonlcon = [];        if nargin < 8, ub = [];            if nargin < 7, lb = [];                if nargin <6, beq = [];                    if nargin <5, Aeq = [];                        if nargin < 4, bineq = [];                            if nargin < 3, Aineq = [];                            end                        end                    end                end            end        end    endend% Is third argument a structureif nargin == 3 && isstruct(Aineq) % Old syntax    options = Aineq; Aineq = [];end% One input argument is for problem structureif nargin == 1    if isa(fun,'struct')        [fun,nvars,Aineq,bineq,Aeq,beq,lb,ub,nonlcon,randstate,randnstate,options] = separateOptimStruct(fun);        % Reset the random number generators        if ~isempty(randstate) && ~isempty(randnstate) && ...                isa(randstate, 'uint32') && isequal(size(randstate),[625, 1]) && ...                isa(randnstate, 'double') && isequal(size(randnstate),[2, 1])            rand('twister',randstate);            randn('state',randnstate);        end    else % Single input and non-structure.        error('gads:ga:invalidStructInput','The input should be a structure with valid fields or provide at least two arguments to GA.' );    endend% If fun is a cell array with additional arguments get the function handleif iscell(fun)    FitnessFcn = fun{1};else    FitnessFcn = fun;end% Only function handles or inlines are allowed for FitnessFcnif isempty(FitnessFcn) ||  ~(isa(FitnessFcn,'inline') || isa(FitnessFcn,'function_handle'))    error('gads:ga:needFunctionHandle','Fitness function must be a function handle.');end% We need to check the nvars here before we call any solvervalid =  isnumeric(nvars) && isscalar(nvars)&& (nvars > 0) ...    && (nvars == floor(nvars));if ~valid    error('gads:ga:notValidNvars','Number of variables (NVARS) must be a positive integer.');enduser_options = options;% Use default options if emptyif ~isempty(options) && ~isa(options,'struct')        error('gads:ga:optionsNotAStruct','Tenth input argument must be a valid structure created with GAOPTIMSET.');elseif isempty(options)    options = defaultopt;end% Take defaults for parameters that are not in options structureoptions = gaoptimset(defaultopt,options);% All inputs should be doubletry    dataType = superiorfloat(nvars,Aineq,bineq,Aeq,beq,lb,ub);    if ~isequal('double', dataType)        error('gads:ga:dataType', ...            'GA only accepts inputs of data type double.')    endcatch    error('gads:ga:dataType', ...        'GA only accepts inputs of data type double.')end[x,fval,exitFlag,output,population,scores,FitnessFcn,nvars,Aineq,bineq,Aeq,beq,lb,ub, ...    NonconFcn,options,Iterate,type] = gacommon(nvars,fun,Aineq,bineq,Aeq,beq,lb,ub,nonlcon,options,user_options);if exitFlag < 0    return;end% Call appropriate single objective optimization solverswitch (output.problemtype)    case 'unconstrained'        [x,fval,exitFlag,output,population,scores] = gaunc(FitnessFcn,nvars, ...            options,output,Iterate);    case {'boundconstraints', 'linearconstraints'}        [x,fval,exitFlag,output,population,scores] = galincon(FitnessFcn,nvars, ...            Aineq,bineq,Aeq,beq,lb,ub,options,output,Iterate);    case 'nonlinearconstr'        [x,fval,exitFlag,output,population,scores] = gacon(FitnessFcn,nvars, ...            Aineq,bineq,Aeq,beq,lb,ub,NonconFcn,options,output,Iterate,type);end

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜一二三区视频| 激情欧美一区二区| 麻豆国产欧美日韩综合精品二区| 国产福利一区二区三区视频 | 久久精品99国产国产精| 不卡视频在线观看| 精品国产91亚洲一区二区三区婷婷 | 欧美日韩视频一区二区| 久久综合色之久久综合| 亚洲永久免费视频| 成人性生交大合| 精品久久久久香蕉网| 亚洲欧美一区二区三区孕妇| 国产美女视频91| 日韩一区二区在线看| 亚洲自拍偷拍av| 91亚洲国产成人精品一区二三| 日韩免费成人网| 午夜久久久久久| 欧美三级三级三级| 亚洲精品国产品国语在线app| 大胆亚洲人体视频| 国产成人亚洲综合a∨婷婷图片| 色婷婷综合中文久久一本| 亚洲一区二区在线播放相泽 | 国产午夜三级一区二区三| 亚洲欧洲制服丝袜| 色偷偷成人一区二区三区91| 国产欧美日韩精品一区| 日韩欧美国产不卡| 精品乱码亚洲一区二区不卡| 91免费在线播放| 粉嫩高潮美女一区二区三区| 欧美日韩精品一二三区| 在线观看国产一区二区| 老鸭窝一区二区久久精品| 日韩av中文字幕一区二区三区| 久久久午夜精品| 97精品电影院| 免费在线欧美视频| 中文字幕在线观看不卡视频| 国产成人精品一区二区三区四区 | 亚洲色图视频网| 99精品在线观看视频| 午夜一区二区三区在线观看| 欧美日韩亚洲丝袜制服| 色综合久久综合| 国产成人免费在线视频| 99精品在线观看视频| 国产一区二区在线视频| 日本vs亚洲vs韩国一区三区二区| 一区二区三区影院| 久久一二三国产| 88在线观看91蜜桃国自产| 在线日韩国产精品| 成人免费黄色在线| 日本va欧美va精品| 色婷婷亚洲综合| 欧美日韩日日骚| 亚洲精品在线观| 一区二区三区日韩| 日韩精品高清不卡| 激情五月婷婷综合网| 国产在线一区观看| 777午夜精品视频在线播放| 色狠狠色狠狠综合| 高清国产一区二区三区| 久久精品国产色蜜蜜麻豆| 亚洲综合区在线| 六月丁香综合在线视频| 色呦呦国产精品| 国产老肥熟一区二区三区| 国产人成亚洲第一网站在线播放| 成人av免费在线| 爽好多水快深点欧美视频| 久久这里都是精品| 欧美性猛交xxxx乱大交退制版| 青青草97国产精品免费观看 | 奇米888四色在线精品| 久久蜜桃一区二区| 欧美在线999| 国产成人午夜精品影院观看视频| 亚洲精品国产品国语在线app| 日韩美女主播在线视频一区二区三区| 国产精品66部| 日韩精品一区第一页| 国产精品久线在线观看| 欧美精选午夜久久久乱码6080| 国产成人免费网站| 免费观看在线色综合| 亚洲欧美日韩在线| 一区视频在线播放| 91麻豆精品91久久久久久清纯| 成人午夜激情在线| 久久99在线观看| 视频一区二区不卡| 亚洲欧美日韩人成在线播放| 制服丝袜激情欧洲亚洲| 精品国产乱码久久久久久蜜臀| av激情综合网| 国产成人精品亚洲午夜麻豆| 日韩精品一区二| 欧美无砖专区一中文字| voyeur盗摄精品| 国产成人8x视频一区二区 | 国产欧美日韩在线| 日韩女优制服丝袜电影| 欧美日韩国产经典色站一区二区三区 | 久久综合九色综合欧美就去吻 | 看电影不卡的网站| 亚洲成人免费在线观看| 亚洲精品视频一区| 亚洲欧洲日韩在线| 日本一区二区三区在线不卡 | 奇米色一区二区| 午夜视频在线观看一区二区 | 99久久99久久精品国产片果冻| 国产精品1024久久| 国产剧情一区在线| 国产精品99久久久久久有的能看| 捆绑紧缚一区二区三区视频| 蜜臀av一区二区| 麻豆国产欧美一区二区三区| 麻豆久久一区二区| 成人app在线观看| aaa国产一区| 色偷偷一区二区三区| 日本精品视频一区二区| 在线精品视频小说1| 欧美色综合网站| 日韩一区二区三区观看| 欧美一级精品在线| 久久久久99精品一区| 亚洲国产精品ⅴa在线观看| 一色屋精品亚洲香蕉网站| 一区二区日韩电影| 日韩福利视频导航| 国产一二精品视频| a亚洲天堂av| 欧美日韩精品系列| 欧美va亚洲va国产综合| 国产网红主播福利一区二区| 中文字幕日本不卡| 午夜精品久久久久久久99樱桃 | 欧美人与z0zoxxxx视频| 日韩免费高清av| 国产精品久久久爽爽爽麻豆色哟哟 | 欧美性一区二区| 欧美一区二区成人6969| 久久精品欧美一区二区三区不卡 | av亚洲精华国产精华| 欧美性生活影院| 欧美大度的电影原声| 国产精品伦理在线| 午夜精品福利一区二区蜜股av| 韩国视频一区二区| 色中色一区二区| 欧美白人最猛性xxxxx69交| 国产精品色在线观看| 亚洲午夜久久久久| 国产老肥熟一区二区三区| 欧美性猛交一区二区三区精品| 日韩欧美国产一区二区三区 | 亚洲免费在线观看视频| 麻豆久久久久久| 在线免费观看一区| 久久综合狠狠综合| 天堂蜜桃一区二区三区| 粉嫩嫩av羞羞动漫久久久| 欧美丰满高潮xxxx喷水动漫| 国产精品久久久久久久久动漫 | 视频在线在亚洲| 91麻豆精东视频| 国产校园另类小说区| 日韩成人免费在线| 在线日韩av片| 中文字幕一区二区三区乱码在线| 免费在线观看精品| 在线观看日产精品| 国产精品久久久久久福利一牛影视| 日韩电影在线免费观看| 色婷婷av一区二区三区软件| 国产欧美日韩三区| 狠狠色丁香婷综合久久| 欧美一区二区三区视频免费| 亚洲精品一二三| av电影在线观看完整版一区二区| 精品久久久久99| 天天影视色香欲综合网老头| 色综合中文字幕国产 | 成人福利视频在线看| 久久亚洲一区二区三区明星换脸| 午夜精品在线看| 色婷婷激情久久| 亚洲欧美日韩国产另类专区| 高清视频一区二区| 国产精品五月天| 不卡的av在线| 国产精品久久99| 成人禁用看黄a在线|