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

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

?? pso.m

?? 這是一個簡單的PSO 實現程序
?? M
字號:
%%####################################################################
%%#### Particle swarm optimization
%%#### With linkage operator
%%#### Deepak devicharan july 2003
%%####################################################################

%%## to apply this to different equations do the following
%%## generate initial particles in a search space close to actual soln
%%## fool around with no of iterations, no of particles, learning rates

%%## for a truly generic PSO do the following
%%## increase the number of particles , increase the variance
%%## i.e let the particles cover a larger area of the search space
%%## then fool around as always with the above thins

%declare the parameters of the optimization

max_iterations = 1000;
no_of_particles = 50;
dimensions = 1;

delta_min = -0.003;
delta_max = 0.003;

c1 = 1.3;
c2 = 1.3;

%initialise the particles and teir velocity components

for count_x = 1:no_of_particles
for count_y = 1:dimensions
particle_position(count_x,count_y) = rand*10;
particle_velocity(count_x,count_y) = rand;
p_best(count_x,count_y) = particle_position(count_x,count_y);
end
end

%initialize the p_best_fitness array
for count = 1:no_of_particles
p_best_fitness(count) = -1000;
end

%particle_position
%particle_velocity

%main particle swarm routine
for count = 1:max_iterations

%find the fitness of each particle
%change fitness function as per equation requiresd and dimensions
for count_x = 1:no_of_particles
%x = particle_position(count_x,1);
%y = particle_position(count_x,2);
%z = particle_position(count_x,3);
%soln = x^2 - 3*y*x + z;

%x = particle_position(count_x); 
%soln = x^2-2*x+1;

x = particle_position(count_x);
soln = x-7;

if soln~=0 
current_fitness(count_x) = 1/abs(soln);  %適應度函數
else
current_fitness =1000;
end
end

%decide on p_best etc for each particle
for count_x = 1:no_of_particles
if current_fitness(count_x) > p_best_fitness(count_x)
p_best_fitness(count_x) = current_fitness(count_x);
for count_y = 1:dimensions
p_best(count_x,count_y) = particle_position(count_x,count_y);
end
end
end

%decide on the global best among all the particles
[g_best_val,g_best_index] = max(current_fitness);

%g_best contains the position of the global best
for count_y = 1:dimensions
g_best(count_y) = particle_position(g_best_index,count_y); 
end

%update the position and velocity compponents
for count_x = 1:no_of_particles
for count_y = 1:dimensions
p_current(count_y) = particle_position(count_x,count_y);
end

for count_y = 1:dimensions
particle_velocity(count_y) = particle_velocity(count_y) + c1*rand*(p_best(count_y)-p_current(count_y)) + c2*rand*(g_best(count_y)-p_current(count_y));
particle_positon(count_x,count_y) = p_current(count_y) +particle_velocity(count_y);
end
end


end

g_best 
current_fitness(g_best_index) 
clear all, clc % pso example






iter = 1000; % number of algorithm iterations
np = 2; % number of model parameters
ns = 10; % number of sets of model parameters
Wmax = 0.9; % maximum inertial weight
Wmin = 0.4; % minimum inertial weight
c1 = 2.0; % parameter in PSO methodology
c2 = 2.0; % parameter in PSO methodology
Pmax = [10 10]; % maximum model parameter value
Pmin = [-10 -10]; % minimum model parameter value
Vmax = [1 1]; % maximum change in model parameter
Vmin = [-1 -1]; % minimum change in model parameter
modelparameters(1:np,1:ns) = 0; % set all model parameter estimates for all model parameter sets to zero
modelparameterchanges(1:np,1:ns) = 0; % set all change in model parameter estimates for all model parameter sets to zero
bestmodelparameters(1:np,1:ns) = 0; % set best model parameter estimates for all model parameter sets to zero
setbestcostfunction(1:ns) = 1e6; % set best cost function of each model parameter set to a large number
globalbestparameters(1:np) = 0; % set best model parameter values for all model parameter sets to zero
bestparameters = globalbestparameters'; % best model parameter values for all model parameter sets (to plot)
globalbestcostfunction = 1e6; % set best cost function for all model parameter sets to a large number
i = 0; % indicates ith algorithm iteration
j = 0; % indicates jth set of model parameters
k = 0; % indicates kth model parameter
for k = 1:np % initialization
for j = 1:ns
modelparameters(k,j) = (Pmax(k)-Pmin(k))*rand(1) + Pmin(k); % randomly distribute model parameters
    modelparameterchanges(k,j) = (Vmax(k)-Vmin(k))*rand(1) + Vmin(k); % randomly distribute change in model parameters
end
end
for i = 2:iter
 for j = 1:ns
x = modelparameters(:,j);
% calculate cost function
costfunction = 105*(x(2)-x(1)^2)^2 + (1-x(1))^2;
    if costfunction < setbestcostfunction(j) % best cost function for jth set of model parameters
bestmodelparameters(:,j) = modelparameters(:,j);
      setbestcostfunction(j) = costfunction;
    end
    if costfunction < globalbestcostfunction % best cost function for all sets of model parameters
globalbestparameters = modelparameters(:,j);
bestparameters(:,i) = globalbestparameters;
     globalbestcostfunction(i) = costfunction;
    else
bestparameters(:,i) = bestparameters(:,i-1);
globalbestcostfunction(i) = globalbestcostfunction(i-1);
    end
  end
  W = Wmax - i*(Wmax-Wmin)/iter; % compute inertial weight
for j = 1:ns % update change in model parameters and model parameters
    for k = 1:np
      modelparameterchanges(k,j) = W*modelparameterchanges(k,j) + c1*rand(1)*(bestmodelparameters(k,j)-modelparameters(k,j))...
         + c2*rand(1)*(globalbestparameters(k) - modelparameters(k,j));
      if modelparameterchanges(k,j) < -Vmax(k), modelparameters(k,j) = modelparameters(k,j) - Vmax(k); end
if modelparameterchanges(k,j) > Vmax(k), modelparameters(k,j) = modelparameters(k,j) + Vmax(k); end
if modelparameterchanges(k,j) > -Vmax(k) & modelparameterchanges(k,j) < Vmax(k), modelparameters(k,j) = modelparameters(k,j) + modelparameterchanges(k,j); end
      if modelparameters(k,j) < Pmin(k), modelparameters(k,j) = Pmin(k); end
      if modelparameters(k,j) > Pmax(k), modelparameters(k,j) = Pmax(k); end
end
end
i;
end
bp = bestparameters; index = linspace(1,iter,iter);
figure; semilogy(globalbestcostfunction,'k');
set(gca,'FontName','Arial','Fontsize',14); axis tight;
xlabel('iteration'); ylabel('cost function');
figure; q = plot(index,bp(1, ,'k-'),index,bp(2, ,'k:'));
set(gca,'FontName','Arial','Fontsize',14); axis tight;
legend(q,'x_1','x_2'); xlabel('iteration'); ylabel('parameter') 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
综合精品久久久| 亚洲欧美一区二区久久| 欧美另类videos死尸| 欧美色图天堂网| 欧美三级中文字| 欧洲一区二区av| 欧美日韩国产123区| 欧美一区日韩一区| 精品捆绑美女sm三区| 精品国产1区二区| 国产欧美一区视频| 亚洲色图视频网站| 亚洲成人7777| 国产一区二区福利视频| 成人手机电影网| 在线观看精品一区| 91精品国产手机| 国产日本亚洲高清| 亚洲三级理论片| 日本视频在线一区| 成人免费黄色在线| 在线观看亚洲精品| 精品国产不卡一区二区三区| 久久久久久久久久看片| 亚洲精选在线视频| 精品一区二区三区视频| 99久久99久久免费精品蜜臀| 欧美日韩精品一二三区| 久久久精品天堂| 亚洲第一av色| 成人18视频在线播放| 538在线一区二区精品国产| 久久婷婷一区二区三区| 亚洲综合在线观看视频| 九一九一国产精品| 色天天综合色天天久久| 久久蜜臀中文字幕| 午夜精品成人在线视频| eeuss鲁一区二区三区| 日韩色在线观看| 亚洲精品视频一区| 国产91丝袜在线播放| 欧美群妇大交群中文字幕| 中文字幕亚洲区| 精品无码三级在线观看视频| 欧美亚洲综合一区| 日本一区二区三区国色天香 | 精品亚洲porn| 欧美日韩精品一二三区| 1000精品久久久久久久久| 久久99九九99精品| 制服丝袜中文字幕一区| 亚洲综合色区另类av| 99久久精品情趣| 中文字幕欧美激情| 国产一区二区三区精品视频| 日韩一卡二卡三卡国产欧美| 亚洲.国产.中文慕字在线| 91精品办公室少妇高潮对白| 亚洲国产成人自拍| 国内精品第一页| 精品国产乱码久久久久久浪潮 | 亚洲日本va午夜在线电影| 国模少妇一区二区三区| 日韩精品一区二区在线观看| 亚洲国产精品自拍| 欧美蜜桃一区二区三区| 亚洲自拍另类综合| 欧美中文字幕一区二区三区 | 亚洲图片欧美综合| 91免费观看视频| 综合激情成人伊人| 91免费观看国产| 亚洲男同性恋视频| 在线视频欧美精品| 亚洲成人av一区二区三区| 欧美二区三区的天堂| 日本色综合中文字幕| 欧美一区二区久久久| 日本不卡在线视频| xfplay精品久久| 顶级嫩模精品视频在线看| 国产精品全国免费观看高清| 91一区二区三区在线播放| 一区二区三区中文在线观看| 欧美精品乱码久久久久久按摩 | 亚洲国产精品精华液网站| 欧美日韩国产高清一区二区三区| 日韩高清在线电影| 精品国产sm最大网站| 成人激情综合网站| 亚洲国产成人高清精品| 精品国产免费一区二区三区香蕉 | 日韩福利电影在线观看| 日韩女优制服丝袜电影| 国产精品一区一区三区| 亚洲欧洲日韩综合一区二区| 欧美三片在线视频观看 | 亚洲永久精品国产| 精品国产一区久久| 色综合天天综合网天天看片| 日本不卡一区二区三区| 欧美国产激情二区三区| 在线观看不卡一区| 免费成人结看片| 国产精品色哟哟网站| 欧美日韩另类国产亚洲欧美一级| 国产一区二区三区四区五区美女 | 中文字幕欧美日本乱码一线二线| 91久久久免费一区二区| 久久国产精品99久久久久久老狼| 国产精品黄色在线观看| 日韩一级黄色片| 在线一区二区三区| 国产成人在线影院| 日本免费在线视频不卡一不卡二| 欧美国产日本韩| 精品国产乱码久久久久久闺蜜 | 久草精品在线观看| 亚洲综合色噜噜狠狠| 久久久99久久| 在线综合视频播放| 色综合久久久久综合99| 国产一区二三区| 天天综合网 天天综合色| 亚洲人成网站在线| 国产日产精品1区| 日韩欧美一区中文| 欧美日韩免费电影| 在线观看亚洲一区| av一二三不卡影片| 国产一区二区三区久久久| 日本欧美在线看| 婷婷成人激情在线网| 亚洲欧美经典视频| 日本一二三四高清不卡| 久久久精品欧美丰满| 精品日韩欧美在线| 日韩一级视频免费观看在线| 在线播放国产精品二区一二区四区 | 欧美一区二区三区免费在线看| 91在线观看下载| 成人91在线观看| 不卡一区二区三区四区| 成人网在线免费视频| 成人一级片网址| 成人午夜精品在线| 成人激情黄色小说| 91视频免费看| 色综合激情久久| 欧洲精品在线观看| 欧美日韩国产精品自在自线| 欧美日韩在线播| 欧美另类z0zxhd电影| 欧美一区二区国产| 欧美成人激情免费网| 2024国产精品| 国产精品对白交换视频| 综合久久给合久久狠狠狠97色| 亚洲欧美日韩小说| 亚洲尤物视频在线| 日本欧美韩国一区三区| 久久激情五月婷婷| 国产精品888| 色综合一个色综合亚洲| 欧美日韩国产高清一区二区| 在线电影欧美成精品| 久久综合九色欧美综合狠狠| 中文字幕av一区二区三区免费看 | 99热精品国产| 在线观看视频一区| 欧美一级一级性生活免费录像| 精品国产亚洲一区二区三区在线观看| 久久午夜羞羞影院免费观看| 中文字幕第一区第二区| 亚洲一线二线三线视频| 毛片基地黄久久久久久天堂| 国产最新精品精品你懂的| 91啪九色porn原创视频在线观看| 精品污污网站免费看| 欧美精品一区二区精品网| 国产精品国产a| 秋霞成人午夜伦在线观看| 成人av在线网站| 在线观看91精品国产麻豆| 国产欧美一区在线| 视频在线在亚洲| 成人黄色av网站在线| 91.xcao| 亚洲免费观看高清完整版在线观看 | 久久国产成人午夜av影院| 99国产精品国产精品毛片| 日韩欧美在线1卡| 亚洲精品日韩专区silk| 久久97超碰色| 欧美日韩精品专区| 国产精品成人网| 麻豆传媒一区二区三区| 欧美午夜理伦三级在线观看| 国产日产欧美一区|