User:Aliasghar68/sandbox

= Harris hawks optimization  =



The Harris hawks optimization (HHO) algorithm is a swarm intelligence optimization method, which is inspired by the team behaviors and chasing patterns of Harris's hawk in nature called surprise pounce.

Exploration phase
The exploration mechanism of HHO is modeled as:

$$ X(t+1) = \left\{\begin{matrix} X_{rand}(t)-r_{1}\left | X_{rand}(t)-2r_{2}X(t) \right | &  q\geq 0.5   \\ (X_{rabbit}(t)-X_{m}(t))-r_{3}(LB+r_{4}(UB-LB)) & q<0.5 \end{matrix}\right.$$

where $$X(t+1)$$ is the location of hawks in the next iteration $$t$$, $$X_{rabbit}(t)$$ is the position of rabbit, $$X(t)$$ is the current location of hawks, $$r_{1}$$, $$r_{2}$$, $$r_{3}$$, $$r_{4}$$, and $$q$$ are random numbers in (0,1), $$LB$$ and $$UB$$ show the upper and lower bounds, $$X_{rand}(t)$$ is a random hawk from the current swarm, and $$X_{m}$$ is the average location of the hawks. The average equation is attained by:

$$ X_{m}(t)=\frac{1}{N}\sum_{i=1}^{N}X_{i}(t) $$

where $$X_{i}(t)$$ shows the location of hawks in iteration $$t$$ and $$N$$ is the size of swarm.

Transition from exploration to exploitation
The transition phase in HHO is performed based on the energy of the rabbit. To model this fact, the energy of a prey is modeled as:

$$ E=2E_{0}(1-\frac{t}{T}) $$

where $$E$$ is the escaping energy of the rabbit, $$T$$ is the maximum iterations, and $$E_{0}$$ is the initial energy.

Soft besiege
When $$r\geq0.5$$ and $$|E|\geq0.5$$, this step is modeled by:

$$X(t+1)=\Delta X(t)-E\left |JX_{rabbit}(t)-X(t)\right |$$

$$\Delta X(t)=X_{rabbit}(t)-X(t)$$

where $$\Delta X(t)$$ is the difference vector in iteration $$t$$, $$r_{5}$$ is a random value inside (0,1), and $$J=2(1-r_{5})$$ is the random jump strength of the rabbit.

Hard besiege
When $$r\geq$$0.5 and $$|E|<$$0.5, the current positions are updated using:

$$X(t+1)=X_{rabbit}(t)-E \left |\Delta X(t) \right |$$

Soft besiege with progressive rapid dives
When still $$|E|\geq$$0.5 but $$r<$$0.5, the hawks will decide on their next move based on:

$$Y=X_{rabbit}(t)-E\left |JX_{rabbit}(t)-X(t)\right |$$

In HHO, hawks will dive based on the Lévy flight patterns using:

$$Z=Y+S\times LF(D)$$

where $$D$$ is the dimension and $$S$$ is a random vector that have the size of $$1\times D$$ and LF is a function to obtain the patterns of Lévy flight using:

$$LF(x)= \frac{u\times \sigma }{\left | v \right |^{\frac{1}{\beta }}}, \sigma =\left ( \frac{\Gamma (1+\beta )\times sin(\frac{\pi\beta}{2})}{\Gamma(\frac{1+\beta}{2})\times \beta\times2^{(\frac{\beta-1}{2})}} \right )^{\frac{1}{\beta}}$$

where $$u$$, $$v$$ are random values in (0,1).

Hence, we have:

$$ X(t+1)=\left\{\begin{matrix} Y & if F(Y)<F(X(t)) \\ Z & if F(Z)<F(X(t)) \\ \end{matrix}\right.$$

where $$Y$$ and $$Z$$ are obtained using previous rules.

Hard besiege with progressive rapid dives
When $$|E|<$$0.5 and $$r<$$0.5, the following rule is performed:

$$X(t+1)=\left\{\begin{matrix} Y & if F(Y)<F(X(t)) \\ Z & if F(Z)<F(X(t)) \\ \end{matrix}\right.$$

where $$Y$$ and $$Z$$ are obtained using:

$$Y=X_{rabbit}(t)-E\left |JX_{rabbit}(t)-X_{m}(t)\right |$$

$$Z=Y+S\times LF(D)$$

Pseudocode of HHO
The pseudocode of the proposed HHO algorithm is reported here.

Inputs: The population size $$N$$ and maximum number of iterations $$T$$ Outputs: The location of rabbit and its fitness value Initialize the random population $$X_{i}(i=1,2,\ldots,N)$$ While stopping condition is not met Calculate the fitness values of hawks Set $$X_{rabbit}$$ as the location of rabbit (best location) For each hawk $$X_{i}$$ Update the initial energy $$E_{0}$$ and jump strength $$J$$ Update the $$E$$ If$$|E|>1$$ Update the location vector the related exploration rules If$$|E|<1$$ Update the location vector the related exploitation rules Return $$X_{rabbit}$$