-
大小: 8KB文件类型: .zip金币: 1下载: 0 次发布日期: 2021-05-10
- 语言: Matlab
- 标签: PSO,MATlab
资源简介
PSO(粒子群算法)MATlab程序,PSO(粒子群算法)MATlab程序,
代码片段和文件信息
function [XFVALEXITFLAGOUTPUT] = PSO(FUNX0LBUBOPTIONSvarargin)
%PSO finds a minimum of a function of several variables using the particle swarm
% optimization (PSO) algorithm originally introduced in 1995 by Kennedy and
% Eberhart. This algorithm was extended by Shi and Eberhart in 1998 through the
% introduction of inertia factors to dampen the velocities of the particles.
% In 2002 Clerc and Kennedy introduced a constriction factor in PSO which was
% later on shown to be superior to the inertia factors. Therefore the algorithm
% using a constriction factor was implemented here.
%
% PSO attempts to solve problems of the form:
% min F(X) subject to: LB <= X <= UB
% X
%
% X=PSO(FUNX0) start at X0 and finds a minimum X to the function FUN.
% FUN accepts input X and returns a scalar function value F evaluated at X.
% X0 may be a scalar vector or matrix.
%
% X=PSO(FUNX0LBUB) 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.
%
% X=PSO(FUNX0LBUBOPTIONS) minimizes with the default optimization
% parameters replaced by values in the structure OPTIONS an argument
% created with the PSOSET function. See PSOSET for details.
% Used options are SWARM_SIZE COGNITIVE_ACC SOCIAL_ACC MAX_ITER
% MAX_TIME MAX_FUN_EVALS TOLX TOLFUN DISPLAY and OUTPUT_FCN.
% Use OPTIONS = [] as a place holder if no options are set.
%
% X=PSO(FUNX0LBUBOPTIONSvarargin) is used to supply a variable
% number of input arguments to the objective function FUN.
%
% [XFVAL]=PSO(FUNX0...) returns the value of the objective
% function FUN at the solution X.
%
% [XFVALEXITFLAG]=PSO(FUNX0...) returns an EXITFLAG that describes the
% exit condition of PSO. Possible values of EXITFLAG and the corresponding
% exit conditions are:
%
% 1 Change in the objective function value less than the specified tolerance.
% 2 Change in X less than the specified tolerance.
% 0 Maximum number of function evaluations or iterations reached.
% -1 Maximum time exceeded.
%
% [XFVALEXITFLAGOUTPUT]=PSO(FUNX0...) returns a structure OUTPUT with
% the number of iterations taken in OUTPUT.nITERATIONS the number of function
% evaluations in OUTPUT.nFUN_EVALS the coordinates of the different particles in
% the swarm in OUTPUT.SWARM the corresponding fitness values in OUTPUT.FITNESS
% the particle‘s best position and its corresponding fitness in OUTPUT.PBEST and
% OUTPUT.PBEST_FITNESS the best position ever achieved by the swarm in
% OUTPUT.GBEST and its corresponding fitness in OUTPUT.GBEST_FITNESS the amount
% of time needed in OUTPUT.TIME and the options used in OUTPUT.OPTIONS.
%
% See also PSOSET PSOGET
% Copyright (C
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2007-10-10 09:43 PSO\
文件 3627 2007-10-10 09:43 PSO\PSOGET.m
文件 14537 2007-10-10 09:43 PSO\PSO.m
文件 5851 2007-10-10 09:43 PSO\PSOSET.m
评论
共有 条评论