<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Standard PSO Version 2007 on MU</title><link>https://choy-mutao.github.io/pso_30/original/spso2007/</link><description>Recent content in Standard PSO Version 2007 on MU</description><generator>Hugo</generator><language>zh-cn</language><atom:link href="https://choy-mutao.github.io/pso_30/original/spso2007/index.xml" rel="self" type="application/rss+xml"/><item><title>参数结构体</title><link>https://choy-mutao.github.io/pso_30/original/spso2007/structs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://choy-mutao.github.io/pso_30/original/spso2007/structs/</guid><description>全局变量 #define D_max 114 //搜索空间的最大维度数 #define R_max 500 //最大运行次数 #define S_max 910 //最大群容量 #define fMax 6 //最大约束数+1 #define zero 0 //1.0e-30//避免数值不稳定 粒子群(Swarm) 定义粒子群中包含
P: 粒子局部最优位置队列(上一代) X: 当前每个粒子的位置特征 V: 当前每个粒子的迭代速度 best: 全局最优位置 struct swarm { int best; // rank of the best particle int S; // Swarm size struct Position P[S_max]; // Previous best positions found by each particle struct Velocity V[S_max]; // Velocities struct Position X[S_max]; // Positions }; 其中:</description></item><item><title>主逻辑</title><link>https://choy-mutao.github.io/pso_30/original/spso2007/pso/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://choy-mutao.github.io/pso_30/original/spso2007/pso/</guid><description>初始化 相较于 SPSO2006, 该版本增加了量化的步骤, 用于处理离散问题的优化
筛选最优解 相较于 SPSO2006, 该版本定义了两种筛选方法
比较评价函数的值与目标值的误差 比较当前位置(解)与目标位置(目标解)的误差 更新拓扑通知 迭代移动 相较于 SPSO2006, 该版本在移动过程中增加了如下步骤
在每次开始移动前对粒子群中的粒子进行随机排序 更新了一种新的速度生成策略 速度生成逻辑 环境判断条件(退出的时机) 相较于 SPSO2006, 该版本增加了更多推出条件, 防止陷入死循环
// Check if finished // If no improvementd, information links will be reinitialized error = P[best_index].f; if (error &amp;gt;= error_prev) init_links = 1; else init_links = 0; error_prev = error; if (error &amp;gt; eps &amp;amp;&amp;amp; nb_eval &amp;lt; eval_max) goto loop; if (error &amp;gt; eps) n_failure = n_failure + 1;</description></item></channel></rss>