Communication
Language
Multi-objective optimization analysis by Non-dominated Sorting Genetic Algorithm (NSGA-II) 1 with Floating Point representation 23 (MATLAB R2007b - ).
This code is validated with MATLAB R2007b or later versions. However, the PlatEMO library (https://github.com/BIMK/PlatEMO), which can operate MATLAB 2018a or later versions, is more convenient and performs faster.
└─NSGA_2_ver3 ├─Bench_mark │ └─進化計算パラメータ │ └─html ├─cores │ └─functions │ └─NSGA_2_functions └─save └─fig
[Step 1] Start GUI form
Open the “GUI.fig” from MATLAB.
[Step 2] Pre-setting
Edit the code for evaluation functions in "./cores/functions/NSGA_2_functions/evaluation_func.m".
function f_vec = evaluation_func(pop_vec)
%% 評価関数 (pop_vecの行が個体番号,列が個体パラメータ)
x_vec = pop_vec;
%% SCH問題:パレート解 -> x in [0,2]
% f_vec = [x_vec(:,1).^2 ...
% (x_vec(:,1) - 2).^2 ];
%% FON問題:パレート解 -> x1 = x2 = x3 in [-1/√3,1/√3]
% f_k = @(k, x_vec)( 1 - exp( -sum( (x_vec + (-1).^k/sqrt(3)).^2 , 2) ) );
% f_vec = [f_k(1, x_vec) ...
% f_k(2, x_vec)];
%% テスト問題2
a = 49;b = 4; c = 0.5;
f_1 = @(x_vec)( 0.5*(x_vec(:,1).^2 + x_vec(:,2).^2) + sin(x_vec(:,1).^2 + x_vec(:,2).^2) );
f_2 = @(x_vec)( -exp( -a*(cos( b*(x_vec(:,1) + x_vec(:,2)) ) - ((x_vec(:,1) - x_vec(:,2))) ).^2 - c*(x_vec(:,1) + x_vec(:,2) + 1).^2 ));
f_3 = @(x_vec)( 1./(x_vec(:,1).^2 + x_vec(:,2).^2 + 1) - 1.1*exp(-(x_vec(:,1).^2 + x_vec(:,2).^2)) );
f_vec = [f_1(x_vec) ...
f_2(x_vec) ...
f_3(x_vec)];
%% MOP3
% f_1 = @(x_vec)( 0.5*(x_vec(:,1).^2 + x_vec(:,2).^2) + sin(x_vec(:,1).^2 + x_vec(:,2).^2) );
% f_2 = @(x_vec)( ( 3*x_vec(:,1) - 2*x_vec(:,2) + 4 ).^2/8 + ( x_vec(:,1) - x_vec(:,2) + 1 ).^2/27 + 15 );
% f_3 = @(x_vec)( 1./(x_vec(:,1).^2 + x_vec(:,2).^2 + 1) - 1.1*exp(-(x_vec(:,1).^2 + x_vec(:,2).^2)) );
%
% f_vec = [f_1(x_vec) ...
% f_2(x_vec) ...
% f_3(x_vec)];
%% テスト問題 (最適解:部分球面)
% g_func = @(x3)( sin(x3) + 1 );
% f_1 = @(x_vec)( (1 + g_func(x_vec(:,3))).*( abs(cos(x_vec(:,1)).*cos(x_vec(:,2)) ) + 1e-3) );
% f_2 = @(x_vec)( (1 + g_func(x_vec(:,3))).*( abs(cos(x_vec(:,1)).*sin(x_vec(:,2)) ) + 1e-3) );
% f_3 = @(x_vec)( (1 + g_func(x_vec(:,3))).*(abs(sin(x_vec(:,1)) ) + 1e-3) );
%
% f_vec = [f_1(x_vec) ...
% f_2(x_vec) ...
% f_3(x_vec)];
Next, push the "Parameters" button and edit parameters, or edit the code for parameters in "./save/param_setting.m".
%% parameter for NSGA-2
%----------------------- 解析パラメータ ------------------------------------
GENERATION = 200; %% GENERATION[-]
TOURNAMENT_RATE = 0.5; %% TOURNAMENT_RATE[-]
CROSSOVER_RATE = 1.0; %% CROSSOVER_RATE[-]
MUTATION_RATE = 0.4; %% 突然変異個体選択率[-]
MUTATION_RATE_1 = 0.8; %% 突然変異率[-]
%----------------------- 個体パラメータ ------------------------------------
MAX_POP_NUM = 500; %% the number of Populations[-]
POP_LGT = 3; %% Length of variable[-]
% Initial value of populations [-]
pop_weight = 0.1*ones(1,POP_LGT);
% Mutation change width
pop_mutation_width = 10*pop_weight;
[Step 3] Start optimization
Push the “exe” button or execute the code in "./cores/exe.m", and wait until the finish of the analysis.
[Step 4] Restart optimization (if solutions do not converge at [Step 3])
Execute the code in "./cores/exe_func_restart.m".
[Step 5] Plot results
Push the “plot” button.
[Step 6] View plotted results
Results (figures and movie) plotted by [Step 4] are in "./save" directory.
Optimal solutions are in h_pop_vec{end}(pop_rank{1},:)
.
Pareto-front is plotted by plot3(f_vec(pop_rank{1},1),f_vec(pop_rank{1},2),f_vec(pop_rank{1},3),'ro')
MOP3 bench problem 4
where,
ZDT3 bench problem 5
where,
The red solid line includes the analytical solution of the Pareto front for the ZDT3 problem,
Namely,
DTLZ7 bench problem 6
where,
Footnotes
-
K. Deb, A. Pratap, S. Agarwal, T. Meyarivan, A fast and elitist multiobjective genetic algorithm: NSGA-II, IEEE Transactions on Evolutionary Computation 6 (2) (2002) 182–197. doi:10.1109/4235.996017. ↩
-
C. Su, A genetic algorithm approach employing floating point representation for economic dispatch of electric power, in: The International Congress on Modelling and Simulation 1997, Vol. 204, 1997, pp. 1444–1449. ↩
-
Reducing the Power Consumption of a Shape Memory Alloy Wire Actuator Drive by Numerical Analysis and Experiment, IEEE/ASME Transactions on Mechatronics, Vol. 23, No. 4 (2018).
https://doi.org/10.1109/TMECH.2018.2836352 ↩ -
Veldhuizen, D.A.V. and Lamont, G.B., Multiobjective evolutionary algorithm test suites, Proceedings of the 1999 ACM symposium on Applied computing, February 1999. ↩
-
Zitzler, E., Thiele, L., Laumanns, M., Fonseca, C., and Fonseca, da V., Performance assessment of multiobjective optimizers: an analysis and review, IEEE Transactions on Evolutionary Computation, Vol. 7, No. 2, pp. 117–132 (2003). ↩
-
K. Deb et al, Scalable Test Problems for Evolutionary Multi-Objective Optimization, TIK-Technical Report No. 112, 2001. ↩