基于matlab编程斯坦纳树的配电网规划研究程序 - matlab算法设计 - 谷速源码
下载频道> 资源分类> matlab源码> 算法设计> 基于matlab编程斯坦纳树的配电网规划研究程序

标题:基于matlab编程斯坦纳树的配电网规划研究程序
分享到:

所属分类: 算法设计 资源类型:程序源码 文件大小: 8.11 KB 上传时间: 2019-12-01 18:28:08 下载次数: 35 资源积分:1分 提 供 者: jiqiren 20191201062738714
内容:
function [xm,fv,fvt]=PSO(fitness,popsize,c1,c2,w,MAXITER,dimension,irange_r,irange_l,xmax,xmin)
format long;
%------初始化种群的个体------------
x=(irange_r- irange_l)*rand(popsize,dimension,1) + irange_l;
%         x(i,j)=randn;  %随机初始化位置
v=(rand(popsize,dimension,1)-0.5)*(irange_r- irange_l);  %随机初始化速度
pbest=x;
gbest=zeros(1,dimension);
%------先计算各个粒子的适应度,并初始化Pi和Pg----------------------
for i=1:popsize
    f_x(i)=fitness(x(i,:));
    f_pbest(i)=f_x(i);
end
g=min(find(f_pbest==min(f_pbest(1:popsize))));
gbest=pbest(g,:);
f_gbest=f_pbest(g);
MINIUM=f_pbest(g);
fvt=ones(1,MAXITER);
%------进入主要循环,按照公式依次迭代------------
for t=1:MAXITER
    for i=1:popsize
        v(i,:)=w*v(i,:)+c1*rand*(pbest(i,:)-x(i,:))+c2*rand*(gbest-x(i,:));
        y1=x(i,:)+v(i,:);
%         y1=min(y,xmax);
        x(i,:)=max(min(y1,xmax),xmin);
        f_x(i)=fitness(x(i,:));
        if f_x(i)<f_pbest(i)
            pbest(i,:)=x(i,:);
            f_pbest(i)=f_x(i);
        end
        if f_pbest(i)<f_gbest
            gbest=pbest(i,:);
            f_gbest=f_pbest(i);
        end
        MINIUM=f_gbest;
    end
    fvt(t)=MINIUM;
    disp(t)
    disp(gbest')
    disp(MINIUM)
end
xm = gbest';
fv = f_gbest;

文件列表(点击上边下载按钮,如果是垃圾文件请在下面评价差评或者投诉):

基于matlab编程斯坦纳树的配电网规划研究程序/
基于matlab编程斯坦纳树的配电网规划研究程序/code/
基于matlab编程斯坦纳树的配电网规划研究程序/code/MST.mat
基于matlab编程斯坦纳树的配电网规划研究程序/code/PSO.m
基于matlab编程斯坦纳树的配电网规划研究程序/code/PSOfit.mat
基于matlab编程斯坦纳树的配电网规划研究程序/code/Prim_algo.m
基于matlab编程斯坦纳树的配电网规划研究程序/code/ST.m
基于matlab编程斯坦纳树的配电网规划研究程序/code/T.mat
基于matlab编程斯坦纳树的配电网规划研究程序/code/final.m
基于matlab编程斯坦纳树的配电网规划研究程序/code/fitness.m
基于matlab编程斯坦纳树的配电网规划研究程序/code/floyd.m
基于matlab编程斯坦纳树的配电网规划研究程序/code/main_basic_OPSO.m
基于matlab编程斯坦纳树的配电网规划研究程序/code/resultPSO20131012.mat

关键词: matlab 编程 斯坦纳树 配电网 规划 研究 程序

Top_arrow
回到顶部
联系方式| 版权声明| 招聘信息| 广告服务| 银行汇款| 法律顾问| 兼职技术| 付款方式| 关于我们|
网站客服网站客服 程序员兼职招聘 程序员兼职招聘
沪ICP备19040327号-3
公安备案号:沪公网安备 31011802003874号
库纳格流体控制系统(上海)有限公司 版权所有
Copyright © 1999-2014, GUSUCODE.COM, All Rights Reserved