Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

%_________________________________________________________________________%

% Whale Optimization Algorithm (WOA) source codes demo 1.0 %


% %
% Developed in MATLAB R2011b(7.13) %
% %
% Author and programmer: Seyedali Mirjalili %
% %
% e-Mail: ali.mirjalili@gmail.com %
% seyedali.mirjalili@griffithuni.edu.au %
% %
% Homepage: http://www.alimirjalili.com %
% %
% Main paper: S. Mirjalili, A. Lewis %
% The Whale Optimization Algorithm, %
% Advances in Engineering Software , in press, %
% DOI: http://dx.doi.org/10.1016/j.advengsoft.2016.01.008 %
% %
%_________________________________________________________________________%

% You can simply define your cost in a seperate file and load its handle to fobj
% The initial parameters that you need are:
%__________________________________________
% fobj = @YourCostFunction
% dim = number of your variables
% Max_iteration = maximum number of generations
% SearchAgents_no = number of search agents
% lb=[lb1,lb2,...,lbn] where lbn is the lower bound of variable n
% ub=[ub1,ub2,...,ubn] where ubn is the upper bound of variable n
% If all the variables have equal lower bound you can just
% define lb and ub as two single number numbers

% To run WOA:
[Best_score,Best_pos,WOA_cg_curve]=WOA(SearchAgents_no,Max_iteration,lb,ub,dim,fobj
)
%__________________________________________

clear all
clc

SearchAgents_no=40; % Number of search agents

Function_name='eld'; % Name of the test function that can be from F1 to F23 (Table
1,2,3 in the paper)

Max_iteration=100; % Maximum numbef of iterations

% Load details of the selected benchmark function


[lb,ub,dim,fobj]=Get_Functions_details(Function_name);

[Best_score,Best_pos,WOA_cg_curve]=WOA(SearchAgents_no,Max_iteration,lb,ub,dim,fobj
);

You might also like