caibanzhu.m ( File view )

  • By chenhaiyan90 2014-05-14
  • View(s):22
  • Download(s):2
  • Point(s): 1
			%% 种群初始化
clearvars -except J D p_number m_number rep_number t_number t1_number tjsj tjmh t2_fbzk d2_fbzk 

maxgen=500;
k_qz=1;
w_start=0.9;
w_end=0.4;
w=w_start;
c1=1.49;
c2=1.49;
xsize=50;
%% 计算程序所需要的基本参数
m_geshu=0;
for i=1:D
    for j=1:p_number(i)
        for k=1:rep_number(i,j)
            for m=1:m_number(i,j)
                m_geshu=m_geshu+1;
                m_index{
1,m_geshu
}=[i,j,k,m];
                m_t(1,m_geshu)=t_number{
i
}(m,j);
            end
        end
    end
end

for i=1:m_geshu
    for j=1:D
        if m_index{
1,i
}(1)==j
           d_index(i)=j;
        end
    end
end
for i=1:D
    m_d(i)=length(d_index(d_index==i));
end
if mod(m_geshu,J)~=0
    row=J;
    col=ceil(m_geshu/J);
else
    row=J;
    col=m_geshu/J;
end
objnum=row*col;
dim=m_geshu;
%% 种群初始最优
for i=1:xsize
    x(i,:)=randsample(1:dim,dim);
end
v=zeros(xsize,dim);
xbest=x;  %个体最佳值
gbest=x(1,:);%粒子群最佳位置
for i=1:xsize
        [fitness_xys(i,1),fitness_xys(i,2)]=shiyingdu1(x(i,:),J,D,m_t,m_index,d_index);
end
%fitness_xgy=fitness_xys;
%fitness_xgy=rscore(fitness_xys);
u=mean(fitness_xys);
sd=std(fitness_xys);
for i=1:2
    if sd(i)==0
       fitness_xgy(:,i)=(fitness_xys(:,i)-u(i));
    else
       fitness_xgy(:,i)=(fitness_xys(:,i)-u(i))./sd(i);
    end
end
fitness_x=-k_qz*fitness_xgy(:,1)+(1-k_qz)*fitness_xgy(:,2);
fitness_best=fitness_x;
[fitnessg_best,fitness_index]=min(fitness_best);
gbest=xbest(fitness_index,:);%群体极值位置

%% 粒子群寻优
for j=1:maxgen
    w=w_start-(w_start-w_end)*(j/maxgen); 
    x=ddgx1(x,xbest,gbest,v,w,c1,c2,objnum,J,D,m_t,m_index);
     for i=1:xsize
         [fitness_xys(i,1),fitness_xys(i,2)]=shiyingdu
...
...
(Please download the complete source code to view)
			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 1

Download
0 lines left, continue to read
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
caibanzhu.m2.58 kB06-01-14|21:11
chushi.m2.40 kB04-01-14|11:12
data.xlsx12.76 kB05-01-14|12:14
data2.xlsx22.48 kB06-01-14|15:20
ddgx1.m524.00 B10-12-13|00:37
ddgx2.m852.00 B06-01-14|21:11
fbzkzhu.m3.25 kB06-01-14|21:11
matlab数据.mat27.48 kB06-01-14|23:02
shiyingdu1.m2.12 kB10-12-13|00:37
shiyingdu2.m1.37 kB06-01-14|21:10
x_suoyin.m88.00 B04-12-13|21:38
测试数据.docx33.70 kB06-01-14|21:43
新建文件夹0.00 B08-01-14|10:53
...
Sponsored links

caibanzhu.m (87.23 kB)

Need 1 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D