1 内容介绍

1.1 灰狼算法介绍

2 仿真代码

%% Non Sorted Grey Wolf Algorithm (NSGWO)
% NSGWO is developed by Pradeep Jangir
%% Objective Function
% The objective function description contains information about the
% objective function. M is the dimension of the objective space, D is the
% dimension of decision variable space, LB and UB are the
% range for the variables in the decision variable space. User has to
% define the objective functions using the decision variables. Make sure to
% edit the function 'evaluate_objective' to suit your needs.
clc
clear all
D = 30; % Number of decision variables
M = 2; % Number of objective functions
K=M+D;
LB = ones(1, D).*0; %  LB - A vector of decimal values which indicate the minimum value for each decision variable.
UB = ones(1, D).*1; % UB - Vector of maximum possible values for decision variables.
Max_iteration = 100;  % Set the maximum number of generation (GEN)
SearchAgents_no = 100;      % Set the population size (Search Agent)
ishow = 10;
%% Initialize the population
% Population is initialized with random values which are within the
% specified range. Each chromosome consists of the decision variables. Also
% the value of the objective functions, rank and crowding distance
% information is also added to the chromosome vector but only the elements
% of the vector which has the decision variables are operated upon to
% perform the genetic operations like corssover and mutation.
chromosome = initialize_variables(SearchAgents_no, M, D, LB, UB);

%% Sort the initialized population
% Sort the population using non-domination-sort. This returns two columns
% for each individual which are the rank and the crowding distance
% corresponding to their position in the front they belong. At this stage
% the rank and the crowding distance for each chromosome is added to the
% chromosome vector for easy of computation.
intermediate_chromosome = non_domination_sort_mod(chromosome, M, D);

%% Perform Selection
% Once the intermediate population is sorted only the best solution is
% selected based on it rank and crowding distance. Each front is filled in
% ascending order until the addition of population size is reached. The
% last front is included in the population based on the individuals with
% least crowding distance
% Select NP fittest solutions using non dominated and crowding distance
% sorting and store in population
Population = replace_chromosome(intermediate_chromosome, M,D,SearchAgents_no);
%% Start the evolution process
% The following are performed in each generation
% * Select the parents which are fit for reproduction
% * Perfrom crossover and Mutation operator on the selected parents
% * Perform Selection from the parents and the offsprings
% * Replace the unfit individuals with the fit individuals to maintain a
%   constant population size.
Pareto = NSGWO(D,M,LB,UB,Population,SearchAgents_no,Max_iteration,ishow);
save Pareto.txt Pareto -ascii;  % save data for future use
%% Plot data
if M == 2
    plot_data2(M,D,Pareto)
elseif M == 3
    plot_data_TCQ(M,D,Pareto); 
end

%% Cited from NSGA-II All rights reserved.
function f = initialize_variables(NP, M, D, LB, UB)

%% function f = initialize_variables(N, M, D, LB, UB) 
% This function initializes the population. Each individual has the
% following at this stage
%       * set of decision variables
%       * objective function values

% where,
% NP - Population size
% M - Number of objective functions
% D - Number of decision variables
% min_range - A vector of decimal values which indicate the minimum value
% for each decision variable.
% max_range - Vector of maximum possible values for decision variables.

min = LB;
max = UB;

% K is the total number of array elements. For ease of computation decision
% variables and objective functions are concatenated to form a single
% array. For crossover and mutation only the decision variables are used
% while for selection, only the objective variable are utilized.

K = M + D;
f=zeros(NP,K);

%% Initialize each individual in population
% For each chromosome perform the following (N is the population size)
for i = 1 : NP
    % Initialize the decision variables based on the minimum and maximum
    % possible values. V is the number of decision variable. A random
    % number is picked between the minimum and maximum possible values for
    % the each decision variable.
    for j = 1 : D
        f(i,j) = min(j) + (max(j) - min(j))*rand(1);
    end % end for j
    % For ease of computation and handling data the chromosome also has the
    % vlaue of the objective function concatenated at the end. The elements
    % D + 1 to K has the objective function valued. 
    % The function evaluate_objective takes one individual at a time,
    % infact only the decision variables are passed to the function along
    % with information about the number of objective functions which are
    % processed and returns the value for the objective functions. These
    % values are now stored at the end of the individual itself.
    f(i,D + 1: K) = evaluate_objective(f(i,1:D));
end % end for i

%% Zitzler1 function (ZDT3)
function f = zdt3 (x)
% Number of objective is 2.
% Number of variables is 30. Range x [0,1]
f = [];
n=length(x);
g=1+9*sum(x(2:n))/(n-1);
f(1)=x(1);
f(2)=1-sqrt(x(1)/g)-(x(1)/g)*sin(10*pi*x(1));

%% Cited from NSGA-II All rights reserved.
function f = initialize_variables(NP, M, D, LB, UB)

%% function f = initialize_variables(N, M, D, LB, UB) 
% This function initializes the population. Each individual has the
% following at this stage
%       * set of decision variables
%       * objective function values

% where,
% NP - Population size
% M - Number of objective functions
% D - Number of decision variables
% min_range - A vector of decimal values which indicate the minimum value
% for each decision variable.
% max_range - Vector of maximum possible values for decision variables.

min = LB;
max = UB;

% K is the total number of array elements. For ease of computation decision
% variables and objective functions are concatenated to form a single
% array. For crossover and mutation only the decision variables are used
% while for selection, only the objective variable are utilized.

K = M + D;
f=zeros(NP,K);

%% Initialize each individual in population
% For each chromosome perform the following (N is the population size)
for i = 1 : NP
    % Initialize the decision variables based on the minimum and maximum
    % possible values. V is the number of decision variable. A random
    % number is picked between the minimum and maximum possible values for
    % the each decision variable.
    for j = 1 : D
        f(i,j) = min(j) + (max(j) - min(j))*rand(1);
    end % end for j
    % For ease of computation and handling data the chromosome also has the
    % vlaue of the objective function concatenated at the end. The elements
    % D + 1 to K has the objective function valued. 
    % The function evaluate_objective takes one individual at a time,
    % infact only the decision variables are passed to the function along
    % with information about the number of objective functions which are
    % processed and returns the value for the objective functions. These
    % values are now stored at the end of the individual itself.
    f(i,D + 1: K) = evaluate_objective(f(i,1:D));
end % end for i

%% Zitzler1 function (ZDT3)
function f = zdt3 (x)
% Number of objective is 2.
% Number of variables is 30. Range x [0,1]
f = [];
n=length(x);
g=1+9*sum(x(2:n))/(n-1);
f(1)=x(1);
f(2)=1-sqrt(x(1)/g)-(x(1)/g)*sin(10*pi*x(1));

%% Cited from NSGA-II All rights reserved.
function f = evaluate_objective(x)

%% function f = evaluate_objective(x)
% Function to evaluate the objective functions for the given input vector
% x. x is an array of decision variables and f(1), f(2), etc are the
% objective functions. The algorithm always minimizes the objective
% function hence if you would like to maximize the function then multiply
% the function by negative one. M is the numebr of objective functions and
% D is the number of decision variables. 
% This functions is basically written by the user who defines his/her own
% objective function. Make sure that the M and D matches your initial user
% input.
% A set of testing function is stored in folder TEST
%% Retrieve function from folder TEST
f = zdt1(x); % change the name of function we can use different functions
end

%% Zitzler1 function (ZDT3)
function f = zdt3 (x)
% Number of objective is 2.
% Number of variables is 30. Range x [0,1]
f = [];
n=length(x);
g=1+9*sum(x(2:n))/(n-1);
f(1)=x(1);
f(2)=1-sqrt(x(1)/g)-(x(1)/g)*sin(10*pi*x(1));

%% Cited from NSGA-II All rights reserved.
function f = evaluate_objective(x)

%% function f = evaluate_objective(x)
% Function to evaluate the objective functions for the given input vector
% x. x is an array of decision variables and f(1), f(2), etc are the
% objective functions. The algorithm always minimizes the objective
% function hence if you would like to maximize the function then multiply
% the function by negative one. M is the numebr of objective functions and
% D is the number of decision variables. 
% This functions is basically written by the user who defines his/her own
% objective function. Make sure that the M and D matches your initial user
% input.
% A set of testing function is stored in folder TEST
%% Retrieve function from folder TEST
f = zdt1(x); % change the name of function we can use different functions
end

3 运行结果

4 参考文献

[1]姜飞. 基于灰狼优化算法的多目标柔性作业车间动态调度研究[D]. 江苏大学.

[2]颜曙林. 基于非支配排序的多目标优化算法改进研究.  2016.

[3]张涛, 余利, 冯朕,等. 基于多目标差分灰狼算法的配电网无功优化方法:, CN109768573A[P]. 2019.

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

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

【智能优化算法-灰狼算法】基于非支配排序灰狼优化器(NS-GWO)算法求解多目标优化算法附matlab代码相关推荐

  1. 多目标优化算法:基于非支配排序的人工兔优化算法(Non-Dominated Sorting Artificial Rabbits Optimization ,NSARO)

    一.人工兔优化算法算法简介 人工兔优化算法(Artificial Rabbits Optimization ,ARO)由Liying Wang等人于2022年提出,该算法模拟了兔子的生存策略,包括绕道 ...

  2. 多目标优化算法:基于非支配排序的瞪羚优化算法(Non-Dominated Sorting Gazelle Optimization Algorithm,NSGOA)

    瞪羚优化算法(Gazelle Optimization Algorithm,GOA)由Agushaka等人于2022年提出,该算法模拟了瞪羚逃避捕食者的行为,思路新颖,性能高效. 瞪羚的身高60-11 ...

  3. 多目标优化算法:基于非支配排序的蜣螂优化算法(Non-Dominated Sorting Dung beetle optimizer,NSDBO)

    蜣螂优化算法(Dung beetle optimizer,DBO)由Jiankai Xue和Bo Shen于2022年提出,该算法主要受蜣螂的滚球.跳舞.觅食.偷窃和繁殖行为的启发所得. 一.蜣螂优化 ...

  4. 信号去噪,基于Sage-Husa自适应卡尔曼滤波器实现海浪磁场噪声抑制及海浪磁场噪声的产生附Matlab代码

    信号去噪,基于Sage-Husa自适应卡尔曼滤波器实现海浪磁场噪声抑制及海浪磁场噪声的产生附Matlab代码 信号处理中的一个关键问题就是信号去噪.在实际应用中,很多信号可能会受到环境噪声的干扰,这些 ...

  5. 多目标优化算法:基于非支配排序的麻雀搜索算法(Non-Dominated Sorting Sparrow Search Algorithm,NSSSA)

    一.麻雀搜索算法 麻雀搜索算法(SSA)的原理参考博客:麻雀搜索算法SSA 二.非支配排序麻雀搜索算法NSSSA 将非支配排序麻雀搜索算法(Non-Dominated Sorting Sparrow ...

  6. 基于深度学习的YOLO目标检测研究-附Matlab代码

    目录 ✳️ 一.引言 ✳️ 二.YOLO的基本思想 ✳️ 三.实验验证 ✳️ 四.参考文献 ✳️ 五.Matlab代码获取 ✳️ 一.引言 目标检测是计算机视觉中的一个研究热点,在很多领域都有应用需求 ...

  7. 【图像检测】基于形态学实现图像目标尺寸测量系统附matlab代码

    1 简介 介绍了一种基于机器视觉技术的目标外观尺寸检测系统.,通过数字图像处理技术获取柚子的纵径,横径,表面积等外观尺寸参数. 2 部分代码 coin_width=1.1000;coin_height ...

  8. 【路径规划】基于遗传算法求解灾情巡视路径问题附matlab代码

    1 内容介绍 灾情巡视属于旅行商问题,具有广泛的应用价值.假定有若干巡视组,分工协作对所辖区域内的各灾民聚集地进行巡视,需要对各巡视组的巡视任务,巡视路线进行合理的分配和设计.在现实生活中,各被巡视地 ...

  9. 基于最小均方误差linear minimum mean square error(LMMSE)插值算法的图像超分辨重构研究-附Matlab代码

    ⭕⭕ 目 录 ⭕⭕ ✳️ 一.引言 ✳️ 二.图像复原基本原理 ✳️ 三.基于多通道LMMSE图像复原法 ✳️ 3.1 最小均方误差LMMSE插值理论 ✳️ 3.2 理论公式对应的Matlab关键代码 ...

  10. 【多目标优化求解】基于matlab非支配排序灰狼优化(NS-GWO)算法求解多目标优化问题【含Matlab源码 2015期】

    一.灰狼算法简介 1 前言: 灰狼优化算法(Grey Wolf Optimizer,GWO)由澳大利亚格里菲斯大学学者 Mirjalili 等人于2014年提出来的一种群智能优化算法.该算法受到了灰狼 ...

最新文章

  1. stream流对象的理解及使用
  2. 如何突破DNS报文的512字节限制
  3. vb破解万能断点816c24
  4. 【Python】Autoviz: 一行代码搞定数据集探索并可视化
  5. 云原生中间件与开源自建TCO对比
  6. centos7 升级curl版本
  7. Java字符串与包装类
  8. node --- 使用mongoose连接mongoDB,并初始化所有的Schema
  9. c语言单元二实验报告,C语言第七次实验报告
  10. 施一公获百万科学界大奖!科研大牛如何炼成?
  11. 《程序设计技术》第三章例程
  12. SoapUI接口测试之实战运用操作(五)
  13. 音视频开发音频处理技术
  14. 小熊的人生回忆(七)
  15. 基于RPA的自动化测试研究
  16. 单反相机的传奇—佳能单反50年辉煌之路(连载十五)
  17. Java程序在内存中运行详解
  18. 大数据运维实战第一课 大话 Hadoop 生态圈
  19. FRED应用: LED混合准直透镜模拟
  20. 什么是大数据?漫谈大数据仓库与挖掘系统

热门文章

  1. Unknown host ‘dl.google.com‘ You may need to adjust the proxy settings in Gradle的解决方案
  2. 农村有人收旧房梁,一根100多,破木头有啥用?
  3. 网上选课系统算法了解
  4. win7磁盘清理_Win7系统使用久变慢怎么办?Windows7系统优化方法
  5. 降维 php,线性降维方法 - 百度开发者中心的个人空间 - OSCHINA - 中文开源技术交流社区...
  6. mysql存小程序获取到的带有表情的昵称_拉取用户信息,带表情的昵称,存储到数据库是???要怎么处理...
  7. onap桂林版部署教程
  8. poi操作PPT读取模板流,生成新PPT文件
  9. 【python教程入门学习】拒绝反爬虫 教你爬虫验证码
  10. 介绍一些ddos产品的厂家