Posts

Showing posts from April, 2022

Matlab code for Bear Smell Search Algorithm (BSSA)

Image
  Bear Smell Search Algorithm  clc; clear; close all; %% parameter setup N=100;                  % number of population Function_name='F1'; % Name of the test function that can be from F1 to   F23  [lb,ub,dim,Fobj]=Get_Functions_details(Function_name); maxiter=500;            % maximum iterations thresh1=1.2;              % threshold 1 thresh2=50;             % threshold 2 % initialize population bear_odour=initialization(N,dim,lb,ub);     % generate initial random population bear_fitness=zeros(1,N);                    % Fitness C1=zeros(N,dim);C2=zeros(N,dim);C3=zeros(N,dim);C4=zeros(N,dim); POC=zeros(N,dim); POf=zeros(1,N); DOC=zeros(N,dim); EOF=zeros(1,N); t=0; Score=inf;  tic; %% main loop begins here while t<maxiter      for i=1:size(bear_odour,1)         Flag4Upperbound=bear_odour(i,:)>ub;         Flag4Lowerbound=bear_odour(i,:)<lb;         bear_odour(i,:)=(bear_odour(i,:).*(~(Flag4Upperbound+Flag4Lowerbound)))+ub.*Flag4Upperbound+lb.*Flag4Lowerbound;         b