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

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

?? pso.m

?? 基本種群規(guī)模改進(jìn)與數(shù)值實(shí)驗(yàn)的PSO算法源程序
?? M
字號(hào):
%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.
%
%  
%                     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
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
极品尤物av久久免费看| 一区二区三区精密机械公司| 色综合天天综合网国产成人综合天| 亚洲午夜免费电影| 日本一区二区三区高清不卡| 欧美日韩国产综合久久| 国产成人一级电影| 日本亚洲电影天堂| 国产精品国产a级| 91精品国产丝袜白色高跟鞋| 色诱视频网站一区| 免费成人在线网站| 亚洲免费资源在线播放| 久久久久久夜精品精品免费| 成人夜色视频网站在线观看| 蜜桃91丨九色丨蝌蚪91桃色| 一区二区三区欧美激情| 国产精品免费丝袜| 欧美精品一区二区三区四区 | 欧美一卡在线观看| 91论坛在线播放| 不卡一区二区三区四区| 国产高清在线观看免费不卡| 精品一区二区三区欧美| 日韩专区一卡二卡| 亚洲国产另类精品专区| 亚洲日本中文字幕区| 欧美国产日韩a欧美在线观看| 国产精品亲子伦对白| 日韩欧美另类在线| 欧美成人一区二区三区片免费 | 国产精品久久久久永久免费观看| 精品成人私密视频| 精品sm在线观看| 精品国产一区二区亚洲人成毛片| 欧美一区二区三区成人| 欧美男同性恋视频网站| 欧美日韩精品是欧美日韩精品| 欧洲生活片亚洲生活在线观看| 色综合网站在线| 色网站国产精品| 色婷婷综合中文久久一本| 波多野结衣亚洲| 97se亚洲国产综合在线| 色偷偷久久人人79超碰人人澡| 日本伦理一区二区| 91久久精品网| 欧美日韩1234| 日韩一区二区三区三四区视频在线观看 | 精品999在线播放| 久久无码av三级| 国产精品丝袜一区| 亚洲视频在线观看三级| 亚洲一区二区三区不卡国产欧美| 亚洲成在线观看| 免费精品99久久国产综合精品| 免费在线成人网| 精品一区二区影视| 成人精品视频.| 色呦呦一区二区三区| 欧美日本免费一区二区三区| 欧美va天堂va视频va在线| 国产无遮挡一区二区三区毛片日本| 中文av一区二区| 亚洲精品自拍动漫在线| 亚洲成人你懂的| 韩国三级中文字幕hd久久精品| 国产成人精品免费视频网站| 91浏览器打开| 日韩久久精品一区| 国产欧美日本一区视频| 亚洲欧美视频在线观看视频| 午夜精品久久久| 久久精品久久久精品美女| 顶级嫩模精品视频在线看| 色哟哟一区二区在线观看| 69av一区二区三区| 国产欧美精品一区二区色综合| 一区二区在线观看视频| 裸体歌舞表演一区二区| 成人午夜精品一区二区三区| 91久久一区二区| 精品日韩av一区二区| 亚洲视频免费在线观看| 日韩精品五月天| 99视频在线精品| 精品久久久久久综合日本欧美| 成人欧美一区二区三区小说| 日本不卡一二三区黄网| 粉嫩蜜臀av国产精品网站| 欧美日韩激情一区二区三区| 国产欧美综合色| 日韩精品一二三四| hitomi一区二区三区精品| 91麻豆精品91久久久久久清纯| 欧美国产乱子伦| 日韩精品一级二级| 日本高清无吗v一区| 国产视频一区二区三区在线观看| 亚洲一区在线观看视频| 岛国av在线一区| 日韩一区二区三区免费观看| 亚洲黄一区二区三区| 国产精品一品二品| 3atv在线一区二区三区| 亚洲美女一区二区三区| 国产成人av电影在线播放| 欧美一区二区网站| 一区二区三区免费在线观看| 成人蜜臀av电影| 欧美激情综合网| 久久99久久99小草精品免视看| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 久久久久国产一区二区三区四区| 日韩在线一二三区| 欧美性一区二区| 亚洲视频 欧洲视频| 成人一道本在线| 中文字幕不卡三区| 国产乱码精品一区二区三区av| 精品欧美久久久| 七七婷婷婷婷精品国产| 欧美日韩国产成人在线91| 一区二区三区欧美| 色诱亚洲精品久久久久久| 中文字幕一区二区三区在线观看| 国产91在线看| 欧美国产欧美亚州国产日韩mv天天看完整| 激情伊人五月天久久综合| 91精品国产综合久久国产大片| 亚洲成人福利片| 欧美日韩国产影片| 丝袜亚洲另类欧美综合| 欧美日韩日日夜夜| 午夜精品免费在线| 欧美一区二区三区四区在线观看| 午夜精品久久久久久久蜜桃app| 欧美日韩免费不卡视频一区二区三区| 一区av在线播放| 欧美三级日本三级少妇99| 亚洲一区二区三区自拍| 欧美偷拍一区二区| 亚洲地区一二三色| 日韩一区二区三区精品视频 | 免费看欧美女人艹b| 欧美一级片在线| 精品一区二区三区视频在线观看| 亚洲精品一区二区三区蜜桃下载| 国产成人免费视频| 国产精品乱码妇女bbbb| 99热在这里有精品免费| 亚洲视频精选在线| 欧美日韩亚洲综合一区| 美女视频黄久久| 久久久九九九九| 99re热这里只有精品免费视频| 亚洲另类一区二区| 9191久久久久久久久久久| 久久丁香综合五月国产三级网站 | 亚洲成人三级小说| 日韩免费视频一区二区| 国产精品一品视频| 玉米视频成人免费看| 91精品欧美一区二区三区综合在 | 久久精品免费在线观看| 91在线高清观看| 日韩综合在线视频| 久久久99精品久久| 日本乱人伦aⅴ精品| 日韩精品一二区| 国产精品亲子乱子伦xxxx裸| 欧美色中文字幕| 国产乱子轮精品视频| 亚洲天堂精品在线观看| 欧美丰满美乳xxx高潮www| 国产老女人精品毛片久久| 最近日韩中文字幕| 91精品蜜臀在线一区尤物| 国产黄色91视频| 视频一区中文字幕| 亚洲国产精品精华液ab| 欧美狂野另类xxxxoooo| 成人免费看的视频| 日本免费新一区视频| 日本一区二区三区在线观看| 欧美性生活一区| 国产91在线观看丝袜| 日产国产高清一区二区三区| 国产精品视频看| 日韩一区二区三区四区| 色狠狠色狠狠综合| 精品一区二区三区不卡| 一二三区精品视频| 国产丝袜欧美中文另类| 欧美放荡的少妇| 99久久久精品免费观看国产蜜| 韩国一区二区在线观看| 五月天欧美精品| 一区二区三区高清| 国产精品婷婷午夜在线观看|