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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? pso.m

?? 粒子群優(yōu)化算法的基本思想是通過群體中個體之間的協(xié)作和信息共享來尋找最優(yōu)解.
?? M
字號:
%PSO >> function for the PSO ALGORITHM
%
% USAGES:   1.) [fxmin, xmin, Swarm, history] = PSO(psoOptions);
%           2.) [fxmin, xmin, Swarm, history] = PSO;
%           3.) fxmin = PSO(psoOptions);
%           3.) PSO 
%           etc.
%
% Arguments     : psoOptions--> A Matlab stucture containing all PSO related options. (see also: get_psoOptions)
% Return Values : [fxmin, xmin, Swarm, history]
%                     |     |       |       |_The history of the algorithm. Depicts how the function value of GBest changes over the run.
%                     |     |       |_The final Swarm. (A matrix containing co-ordinates of all particles)
%                     |     |_The co-ordinates of Best (ever) particle found during the PSO's run.
%                     |__The objective value of Best (^xmin) particle.
%
%  History        :   Author      :   JAG (Jagatpreet Singh)
%                     Created on  :   05022003 (Friday. 2nd May, 2003)
%                     Comments    :   The basic PSO algorithm.
%                     Modified on :   0710003 (Thursday. 10th July, 2003)
%                     Comments    :   It uses psoOptions structure now. More organized.
%  
%                     see also: get_psoOptions
function [fxmin, xmin, Swarm, history] = PSO(psoOptions)

%Globals
global psoFlags;
global psoVars;
global psoSParameters;
global notifications;


upbnd = 600; % Upper bound for init. of the swarm
lwbnd = 300; % Lower bound for init. of the swarm
GM = 0; % Global minimum (used in the stopping criterion)
ErrGoal = 1e-10; % Desired accuracy
% 

%Initializations
if nargin == 0
    psoOptions = get_psoOptions;
end


%For Displaying 
if psoOptions.Flags.ShowViz
    global vizAxes; %Use the specified axes if using GUI or create a new global if called from command window
    vizAxes = plot(0,0, '.');
    axis([-1000 1000 -1000 1000 -1000 1000]);   %Initially set to a cube of this size
    axis square;
    grid off;
    set(vizAxes,'EraseMode','xor','MarkerSize',15); %Set it to show particles.
    pause(1);
end
%End Display initialization

% Initializing variables
success = 0; % Success Flag
iter = 0;   % Iterations' counter
fevals = 0; % Function evaluations' counter

% Using params---
% Determine the value of weight change
w_start = psoOptions.SParams.w_start;   %Initial inertia weight's value
w_end = psoOptions.SParams.w_end;       %Final inertia weight
w_varyfor = floor(psoOptions.SParams.w_varyfor*psoOptions.Vars.Iterations); %Weight change step. Defines total number of iterations for which weight is changed.
w_now = w_start;
inertdec = (w_start-w_end)/w_varyfor; %Inertia weight's change per iteration

% Initialize Swarm and Velocity
SwarmSize = psoOptions.Vars.SwarmSize;
Swarm = rand(SwarmSize, psoOptions.Vars.Dim)*(psoOptions.Obj.ub-psoOptions.Obj.lb) + psoOptions.Obj.lb;
VStep = rand(SwarmSize, psoOptions.Vars.Dim);

f2eval = psoOptions.Obj.f2eval; %The objective function to optimize.

%Find initial function values.
fSwarm = feval(f2eval, Swarm);
fevals = fevals + SwarmSize;

% Initializing the Best positions matrix and
% the corresponding function values
PBest = Swarm;
fPBest = fSwarm;

% Finding best particle in initial population
[fGBest, g] = min(fSwarm);
lastbpf = fGBest;
Best = Swarm(g,:); %Used to keep track of the Best particle ever
fBest = fGBest;
history = [0, fGBest];

if psoOptions.Flags.Neighbor
    % Define social neighborhoods for all the particles
    for i = 1:SwarmSize
        lo = mod(i-psoOptions.SParam.Nhood:i+psoOptions.SParam.Nhood, SwarmSize);
        nhood(i,:) = [lo];
    end
    nhood(find(nhood==0)) = SwarmSize; %Replace zeros with the index of last particle.
end

if psoOptions.Disp.Interval & (rem(iter, psoOptions.Disp.Interval) == 0)
    disp(sprintf('Iterations\t\tfGBest\t\t\tfevals'));
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                  THE  PSO  LOOP                          %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
while( (success == 0) & (iter <= psoOptions.Vars.Iterations) )
    iter = iter+1;
    
    % Update the value of the inertia weight w
    if (iter<=w_varyfor) & (iter > 1)
        w_now = w_now - inertdec; %Change inertia weight
    end
    
    
    %%%%%%%%%%%%%%%%%
    % The PLAIN PSO %
    
    % Set GBest
    A = repmat(Swarm(g,:), SwarmSize, 1); %A = GBest. repmat(X, m, n) repeats the matrix X in m rows by n columns.
    B = A; %B wil be nBest (best neighbor) matrix
    
    % use neighborhood model
    % circular neighborhood is used
    if psoOptions.Flags.Neighbor
        for i = 1:SwarmSize
            [fNBest(i), nb(i)] = min(fSwarm( find(nhood(i)) ));
            B(i, :) = Swarm(nb(i), :);
        end
    end
        
    % Generate Random Numbers
    R1 = rand(SwarmSize, psoOptions.Vars.Dim);
    R2 = rand(SwarmSize, psoOptions.Vars.Dim);
    
    % Calculate Velocity
    if ~psoOptions.Flags.Neighbor %Normal
        VStep = w_now*VStep + psoOptions.SParams.c1*R1.*(PBest-Swarm) + psoOptions.SParams.c2*R2.*(A-Swarm);
    else %With neighborhood
        R3 = rand(SwarmSize, psoOptions.Vars.Dim); %random nos for neighborhood
        VStep = w_now*VStep + psoOptions.SParams.c1*R1.*(PBest-Swarm) + psoOptionsSParams.c2*R2.*(A-Swarm) + psoOptionsSParams.c3*R3.*(B-Swarm);
    end
    
    % Apply Vmax Operator for v > Vmax
    changeRows = VStep > psoOptions.SParams.Vmax;
    VStep(find(changeRows)) = psoOptions.SParams.Vmax;
    % Apply Vmax Operator for v < -Vmax
    changeRows = VStep < -psoOptions.SParams.Vmax;
    VStep(find(changeRows)) = -psoOptions.SParams.Vmax;
    
    % ::UPDATE POSITIONS OF PARTICLES::
    Swarm = Swarm + psoOptions.SParams.Chi * VStep;    % Evaluate new Swarm
    
    fSwarm = feval(f2eval, Swarm);
    fevals = fevals + SwarmSize;
    
    % Updating the best position for each particle
    changeRows = fSwarm < fPBest;
    fPBest(find(changeRows)) = fSwarm(find(changeRows));
    PBest(find(changeRows), :) = Swarm(find(changeRows), :);
    
    lastbpart = PBest(g, :);
    % Updating index g
    [fGBest, g] = min(fPBest);

    %Update Best. Only if fitness has improved.
    if fGBest < lastbpf
        [fBest, b] = min(fPBest);
        Best = PBest(b,:);
    end
    
    %%OUTPUT%%
    if psoOptions.Save.Interval & (rem(iter, psoOptions.Save.Interval) == 0)
        history((size(history,1)+1), :) = [iter, fBest];
    end
    
    if psoOptions.Disp.Interval & (rem(iter, psoOptions.Disp.Interval) == 0)
        disp(sprintf('%4d\t\t\t%.5g\t\t\t%5d', iter, fGBest, fevals));
    end

    if psoOptions.Flags.ShowViz
        [fworst, worst] = max(fGBest);
        DrawSwarm(Swarm, SwarmSize, iter, psoOptions.Vars.Dim, Swarm(g,:), vizAxes);
    end
    
    %%TERMINATION%%
    if abs(fGBest-psoOptions.Obj.GM) <= psoOptions.Vars.ErrGoal     %GBest
        success = 1;
    elseif abs(fBest-psoOptions.Obj.GM)<=psoOptions.Vars.ErrGoal    %Best
        success = 1
    else
        lastbpf = fGBest; %To be used to find Best
    end

    
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                  END  OF PSO  LOOP                       %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



[fxmin, b] = min(fPBest);
xmin = PBest(b, :);

history = history(:,1);
%Comment below line to Return Swarm. Uncomment to return previous best positions.
% Swarm = PBest; %Return PBest

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区三区视频| 色综合天天综合色综合av| 欧美日韩夫妻久久| 午夜精品久久久久久久| 欧美男男青年gay1069videost| 亚洲成人1区2区| 日韩一级免费观看| 国产一区二区精品在线观看| 国产日韩av一区| 一本一本大道香蕉久在线精品 | 久久精品亚洲麻豆av一区二区| 国内成人精品2018免费看| 久久一二三国产| 播五月开心婷婷综合| 亚洲一区二区三区四区五区中文 | 色婷婷av一区二区| 丝瓜av网站精品一区二区 | 欧美日韩国产精选| 黑人精品欧美一区二区蜜桃| 国产精品天干天干在线综合| 91看片淫黄大片一级在线观看| 一区二区三区在线看| 欧美一区午夜视频在线观看| 国产激情视频一区二区在线观看| 亚洲另类在线视频| 日韩欧美国产午夜精品| av亚洲精华国产精华精| 五月激情六月综合| 国产性天天综合网| 欧美日韩一区三区四区| 国产精品综合在线视频| 亚洲男人的天堂在线观看| 91精选在线观看| 99麻豆久久久国产精品免费优播| 天天色图综合网| 中文字幕欧美三区| 正在播放亚洲一区| 北条麻妃一区二区三区| 免费观看一级特黄欧美大片| 亚洲欧美日韩久久精品| 久久亚洲一区二区三区四区| 精品视频123区在线观看| 国产成人av一区| 六月丁香婷婷久久| 亚洲国产wwwccc36天堂| 国产精品进线69影院| 日韩一级黄色片| 欧美性xxxxx极品少妇| 国产成人av一区二区三区在线观看| 日韩精品高清不卡| 中文字幕一区二区三| 欧美岛国在线观看| 5月丁香婷婷综合| 色综合视频一区二区三区高清| 国产美女av一区二区三区| 日韩av电影免费观看高清完整版| 亚洲精品国久久99热| 国产精品久久毛片| 久久久综合精品| 久久亚洲影视婷婷| 精品国产第一区二区三区观看体验 | 日本一区二区久久| 久久九九99视频| 精品久久人人做人人爰| 欧美一卡2卡3卡4卡| 欧美日韩一区二区三区不卡| 91浏览器在线视频| 91网站在线播放| 91在线免费播放| 成人一区在线观看| 国产成人精品www牛牛影视| 久久电影网电视剧免费观看| 老汉av免费一区二区三区| 丝袜亚洲另类欧美| 日韩av网站在线观看| 日本少妇一区二区| 免费看日韩精品| 日本亚洲免费观看| 精品在线一区二区| 蜜臀av一区二区在线免费观看 | 欧美激情一区二区三区不卡| 欧美激情在线观看视频免费| 国产日韩欧美综合一区| 久久久青草青青国产亚洲免观| 欧美大度的电影原声| 久久久久久久综合色一本| 久久亚洲春色中文字幕久久久| 欧美成人综合网站| 国产日产欧美一区二区三区 | 2020国产精品| 国产人伦精品一区二区| ㊣最新国产の精品bt伙计久久| 亚洲免费av高清| 亚洲高清免费视频| 免费欧美在线视频| 国产精品一区二区在线播放 | 91伊人久久大香线蕉| 色婷婷久久久久swag精品| 欧美日韩成人一区二区| 欧美一级在线视频| 国产欧美视频在线观看| 日韩一区在线播放| 亚洲va中文字幕| 国产激情91久久精品导航| av男人天堂一区| 欧美日韩亚洲综合一区| 久久婷婷色综合| 最新不卡av在线| 日韩 欧美一区二区三区| 国产成人欧美日韩在线电影| 色婷婷久久久综合中文字幕| 91精品国产综合久久精品麻豆| 久久综合网色—综合色88| 国产精品久久久久桃色tv| 午夜精品aaa| 成人三级伦理片| 在线电影院国产精品| 国产精品丝袜一区| 视频精品一区二区| 不卡电影一区二区三区| 日韩欧美国产午夜精品| 亚洲欧美日韩国产一区二区三区| 蜜臀av性久久久久蜜臀aⅴ流畅| 懂色av一区二区在线播放| 欧美日韩国产精选| 亚洲少妇30p| 激情久久五月天| 欧美日韩国产首页| 自拍偷拍亚洲欧美日韩| 久久成人羞羞网站| 欧美日韩一级二级三级| 中文字幕人成不卡一区| 精品一区二区三区的国产在线播放 | 国产成人在线观看| 3d动漫精品啪啪1区2区免费| 国产精品电影院| 国产一区二区视频在线播放| 欧美日韩性生活| 1区2区3区精品视频| 国产成a人亚洲| 欧美不卡激情三级在线观看| 亚洲国产另类av| 91一区一区三区| 国产精品久久久久影院亚瑟| 精品一区二区三区免费毛片爱| 欧美日韩日本视频| 亚洲精品写真福利| 97精品久久久午夜一区二区三区| 久久久不卡影院| 国产呦精品一区二区三区网站| 欧美一级专区免费大片| 婷婷久久综合九色综合伊人色| 在线亚洲一区观看| 亚洲视频网在线直播| 成人午夜视频免费看| 久久五月婷婷丁香社区| 国产一区二区三区免费播放 | 国产成人在线免费| 久久精品视频在线看| 国产又粗又猛又爽又黄91精品| 日韩一区二区影院| 蜜桃视频在线观看一区| 69堂成人精品免费视频| 天天综合色天天综合| 欧美日韩国产高清一区二区| 亚洲一区二区三区中文字幕在线| 色88888久久久久久影院按摩| 亚洲欧美精品午睡沙发| 91首页免费视频| 亚洲男女一区二区三区| 日本高清不卡在线观看| 一区二区三区电影在线播| 欧美亚洲国产一区二区三区va| 一区二区三区中文免费| 欧美性xxxxx极品少妇| 日韩精品福利网| 精品国产精品网麻豆系列| 国产a区久久久| 亚洲男人的天堂网| 欧美情侣在线播放| 久久精品国产99久久6| 久久久www免费人成精品| 成av人片一区二区| 亚洲一区二区视频在线| 日韩欧美一二区| 国产高清亚洲一区| 亚洲欧洲av在线| 欧美日韩国产高清一区二区三区| 日本伊人午夜精品| 久久久不卡网国产精品一区| www.在线成人| 一区二区高清免费观看影视大全| 欧美狂野另类xxxxoooo| 久久99精品久久久久久动态图| 国产女主播视频一区二区| 色域天天综合网| 久久99这里只有精品| 中文字幕一区视频| 欧美精品久久天天躁| 国产一区中文字幕|