非支配排序的鲸鱼优化算法(Non-Dominated Sorting Whale Optimization Algorithm,NSWOA)由Pradeep Jangir和 Narottam Jangir于2017年提出。
多目标鲸鱼优化算法不同于上一篇文章---多目标灰狼算法,多目标灰狼算法采用的是网格机制对非支配解进行不断地存储与替换,最终得到一组非支配解。而鲸鱼优化算法采用的是传统的非支配方式,使用起来更加高效。大家可以对比着上一期的多目标灰狼进行学习。
多目标鲸鱼算法在ZDT1,ZDT2,ZDT3中的表现如下:
ZDT1:
ZDT2:
ZDT3:
多目标鲸鱼算法的执行效率还是相当高的,代码写的也很清楚简单。
主函数代码:
%% Objective Functionclc
clc
clear
close 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
chromosome = initialize_variables(SearchAgents_no, M, D, LB, UB);
%% Sort the initialized population
intermediate_chromosome = non_domination_sort_mod(chromosome, M, D);
%% Perform Selection
Population = replace_chromosome(intermediate_chromosome, M,D,SearchAgents_no);
%% Start the evolution process
Pareto = NSWOA(D,M,LB,UB,Population,SearchAgents_no,Max_iteration,ishow);
save Pareto.txt Pareto -ascii; % save data for future use
%% Plot data
plot_data2(M,D,Pareto)
免费完整代码获取,后台回复关键词:
多目标02