资源简介
用于多目标优化问题的学习程序,解决带有约束问题的多目标优化问题。
代码片段和文件信息
function excise_lanjiabiao_NSGA_2()
%% Main Function
%此程序运用NSGA-II的方法求解带有约束问题的多目标优化问题。
%优化的目标为:f1=x1;
% f2=(1+x2)/x1;
%约束的条件为:
% g1=x2+9*x1>=6;
% g2=9*x1-x2>=1;
% 0.1= % Main program to run the NSGA-II MOEA.
% Read the corresponding documentation to learn more about multiobjective
% optimization using evolutionary algorithms.
%inp_para_definition=input_parameters_definition;
%% Initialize the variables
% Declare the variables and initialize their values
% pop - population 种群数量
% gen - generations 总共的后代个数
clear;clc;tic;
pop = input(‘输入每一代的种群数 \n‘); % 每一代的种群数
gen = input(‘输入总共的后代数 \n‘); % 总共的代数
M = 2; % M is the number of objectives.
V = 2; % V is the number of decision variables.
% Initialize the population 种群初始化
chromosome = initialize_variables(pop);
%% 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.
chromosome = non_domination_sort_mod(chromosome);
%% Start the evolution process
% The following are performed in each generation
% Select the parents
% Perfrom crossover and Mutation operator
% Perform Selection
fprintf(‘杂交的后代数—以10递增输出 \n‘);
for i = 1 : gen
% Select the parents
% Parents are selected for reproduction to generate offspring. The
% original NSGA-II uses a binary tournament selection based on the
% crowded-comparision operator. The arguments are
% pool - size of the mating pool. It is common to have this to be half the
% population size.
% tour - Tournament size. Original NSGA-II uses a binary tournament
% selection but to see the effect of tournament size this is kept
% arbitary to be choosen by the user.
pool = round(pop/2);
tour = 2;
%下面进行二人锦标赛配对,新的群体规模是原来群体的一半
parent_chromosome = tournament_selection(chromosomepooltour);
% Perfrom crossover and Mutation operator
% The original NSGA-II algorithm uses Simulated Binary Crossover (SBX) and
% Polynomial crossover. Crossover probability pc = 0.9 and mutation
% probability is pm = 1/n where n is the number of decision variables.
% Both real-coded GA and binary-coded GA are implemented in the original
% algorithm while in this program only the real-coded GA is considered.
% The distribution indeices for crossover and mutation operators as mu = 20
% and mum = 20 respectively.
mu = 20;
mum = 20;
% 针对对象是上一步产生的新的个体parent_chromosome
%对parent_chromosome 每次操作以较大的概率进行交叉(产生两个新的候选人),或者较小的概率变异(一个新的候选人)操作,这样
%就会产生较多的新个体
offspring_chromosome = genetic_operator(parent_chromosomemumum);
% Intermediate population
% Intermediate population is the combined population of parents and
% offsprings of the current generation. The population size is almost
相关资源
- NSGA2-matlaB
- NSGA-3matlab源程序
- 多目标粒子群算法
- MOEA/D、MOP多目标分解算法代码,MATL
- NSGAII解决TSP问题matlab源码
- MOPKSVD等算法的图像稀疏表示代码
- MOPSO-Iran
- NSGA matlab编写的基于粒子群优化算法的
- MOPSO-matlab
- MOEA 几种多目标优化算法集合
- NSGA-II 利用matlab编写的遗传算法程序
- NSGA-II 多目标无功优化算法
- Deb_NSGA-II 基于pareto的多目标遗传算法
- microgrid_nsga2
- 多目标微粒子群算法MOPSO MATLAB代码
- NSGA2代码;非常使用的遗传算法代码
- NSGA-II Matlab代码
- NSGA2优化算法Matlab求解多目标优化问题
- NSGAII代码——matlab版
- NSGAII在ZDT和DTLZ测试函数的matlab代码
- 多目标粒子群优化算法+多目标进化
- NSGA-II 多目标遗传算法
- NSGA-III完美运行MATLAB
评论
共有 条评论