【优化求解】 基于混合粒子群和引力搜索算法PSOGSA求解单目标问题matlab代码

251 阅读1分钟

1 简介

从粒子惯性质量的修正、粒子的精英保留策略以及粒子的全局记忆能力出发,针对 GSA 算法的加速机制和全局搜索策略做相应改进,可得到结合PSO 算法和 GSA 算法优点的 PSO-GSA 算法。

2 部分代码

%PSOGSA source code v3.0, Generated by SeyedAli Mirjalili, 2011. 
%Adopted from: S. Mirjalili, S.Z. Mohd Hashim, 揂 New Hybrid PSOGSA 
%Algorithm for Function Optimization, in IEEE International Conference 
%on Computer and Information Application?ICCIA 2010), China, 2010, pp.374-377.

clear all
clc

N = 30;                        % Size of the swarm " no of objects "
Max_Iteration = 1000;              % Maximum number of "iterations"

Benchmark_Function_ID=1 %Benchmark function ID

[gBestScore,gBest,GlobalBestCost]= PSOGSA(Benchmark_Function_ID, N, Max_Iteration)

gBest
gBestScore
semilogy(GlobalBestCost,'-r');
title(['\fontsize{12}\bf Benchmark Function: F',num2str(Benchmark_Function_ID)]);
xlabel('\fontsize{12}\bf Iteration');ylabel('\fontsize{12}\bf Fitness(Best-so-far)');
legend('\fontsize{10}\bf PSOGSA',1);

3 仿真结果

4 参考文献

[1]巢渊, 戴敏, 陈恺, 陈平, & 张志胜. (2015). 基于广义反向粒子群与引力搜索混合算法的多阈值图像分割. 光学精密工程, 23(3), 8.

部分理论引用网络文献,若有侵权联系博主删除。

5 MATLAB代码与数据下载地址

见博客主页