多目標(biāo)飛蛾撲火算法 (NSMFO) 附matlab代碼
?作者簡介:熱愛科研的
開發(fā)者,修心和技術(shù)同步精進(jìn),matlab項(xiàng)目合作可私信。??個人主頁:Matlab科研工作室
??個人信條:格物致知。
? 內(nèi)容介紹
這篇新穎的文章介紹了最近提出的蛾火焰優(yōu)化器 (MFO) 的多目標(biāo)版本,稱為非支配排序蛾火焰優(yōu)化器 (NSMFO)。所提出的 NSMFO 算法的工作方式是,它首先收集所有非支配 Pareto 最優(yōu)解,直到最后一次迭代極限的演化。然后使用基于解決方案覆蓋范圍的擁擠距離機(jī)制作為導(dǎo)航策略,從所有 Pareto 最優(yōu)解的集合中選擇最佳解決方案,以引導(dǎo)飛蛾朝向多目標(biāo)搜索空間的主導(dǎo)區(qū)域。為了驗(yàn)證所提出的 NSMFO 算法的效率和有效性,將其應(yīng)用于一組標(biāo)準(zhǔn)的無約束、約束和工程設(shè)計(jì)問題。
? 部分代碼
%% Non Sorted Moth-flame?
?Algorithm (NSMFO)% NSMFO 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 = NSMFO(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
? 運(yùn)行結(jié)果

? 參考文獻(xiàn)
Pradeep J, Indrajit N T. Non-Dominated Sorting Moth Flame Optimizer: A Novel Multi-Objective Optimization Algorithm for Solving Engineering Design Problems. Eng Technol Open Acc。2018; 2(1): 555579. 10.19080/ETOAJ.2018.02.555579
? 完整代碼
??部分理論引用網(wǎng)絡(luò)文獻(xiàn),若有侵權(quán)聯(lián)系博主刪除
?? 關(guān)注我領(lǐng)取海量matlab電子書和數(shù)學(xué)建模資料
?