-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlotResults.m
48 lines (38 loc) · 1.26 KB
/
PlotResults.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Golden Eagle Optimizer (GEO) source codes version 1.0
%
% Developed in: MATLAB 9.6 (R2019a)
%
% Programmer: Abdolkarim Mohammadi-Balani
%
% Original paper: Abdolkarim Mohammadi-Balani, Mahmoud Dehghan Nayeri,
% Adel Azar, Mohammadreza Taghizadeh-Yazdi,
% Golden Eagle Optimizer: A nature-inspired
% metaheuristic algorithm, Computers & Industrial Engineering.
%
% https://doi.org/10.1016/j.cie.2020.107050
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function PlotResults (fun,lb,ub, FunctionNumber,ConvergenceCurve)
% ----------------
close ('all');
figure ('Position', [469,200,887,395]);
% ----------------
subplot (1,2, 1)
NumPoints = 100;
[SurfX,SurfY] = meshgrid (linspace(lb(1),ub(1),NumPoints),linspace(lb(2),ub(2),NumPoints));
SurfZ = reshape(fun([SurfX(:),SurfY(:)]),NumPoints,NumPoints);
surf (SurfX,SurfY,SurfZ, 'EdgeAlpha',0.2);
box ('on');
title ('Landscape');
% ----------------
subplot (1,2, 2)
stairs (ConvergenceCurve, 'r', 'LineWidth',2);
grid ('on');
ax = gca;
ax.YScale = 'log';
axis tight;
title ('Convergence curve');
% ----------------
sgtitle (sprintf('F%d',FunctionNumber), 'FontWeight','Bold');