3.2.5. Defense Mechanism (Defense Mec)

Since they have historically been preyed upon, the horses' behavior reflects this. Horses fight for food and water to keep rivals at bay and to avoid hazardous areas where foes such as wolves may lurk. They also buck when caught. Horses engage in a fightor-flight reaction to defend themselves [38]. In the HHO approach, the horses' defense

mechanism allows them to escape from any other horses that display inappropriate or unfavorable behavior. This characteristic describes their main line of defense. As mentioned earlier, horses must flee from or engage in combat with their adversaries. A young or adult horse has such a defense system in place whenever it is practical. Equations (35) and (36) describe the defensive strategies of horses that do not allow other animals to enter dangerous regions.

$$DefenseMec\_{m}^{iter,age} = defensememc\_{m}^{iter,age} \left[ \left( \frac{1}{qN} \sum\_{j=1}^{qN} P\_{j}^{iter-1} \right) - P^{iter-1} \right] \tag{36}$$

Age = α, β, γ, δ

$$
overline{\text{semsemec}}\_{m}^{\text{iter,age}} = \text{defensement}\_{m}^{\text{iter-1,age}} \times \omega\_{\text{defensement}} \tag{37}$$

From the above equations, we have the following:

*Def ense Meciter*,*age <sup>m</sup>* , based on the average location of a horse in the worst *<sup>P</sup>* position, describes the escape vector of the ith horse.

Here, q is equal to 20% of the total number of horses, and qN displays the number of horses in the poorest situations.

*ωdef ense mec* indicates the earlier determined reduction factor per cycle for iter.

### 3.2.6. Roam(Roam)

Horses travel and graze around the countryside in search of nourishment, moving from pasture to pasture. Although they maintain the aforementioned feature, most horses are kept in stables. A horse could rapidly switch where it grazes. Due to their intense curiosity, horses routinely visit other pastures to familiarize themselves with their environment. Through the side walls of their enclosures, the horses can see one another, and a suitable stable satisfies their need for socialization [38].

The program mimics this behavior by using factor r, which is nothing more than a random movement. When horses are young, roaming is almost never observed, and it gradually decreases as they grow older. Equations (37) and (38) depict the variables of roaming.

$$
bar{m}\_{m}^{\text{iter,age}} = \text{round}\_{m}^{\text{iter,age}} \delta \mathbf{P}(\text{iter} - 1)\tag{38}$$

Age γ, δ

$$
tau\_m^{\text{iter}, \text{age}} = \text{round}\_m^{\text{iter}-1, \text{age}} \times \omega\_{\text{roam}} \tag{39}
$$

*Roamiter*,*age <sup>m</sup>* is the ith horse's arbitrary velocity vector for local searches and escapes from local minima.

*ωroam* = factor of reduction in the *roam iter*,*age <sup>m</sup>* /cycle.

Substituting the outcomes from (28) to (39) into Equations (24)–(27), the generic velocity vector may be established.

The velocity of the horses belonging to the age group of 0–5 years is defined as follows, which is defined as δ.

$$\begin{aligned} \left[ \mathrm{Vol}\_{m}^{iter,\delta} = \left[ \omega\_{\mathcal{S}} \times \mathrm{g}\_{m}^{iter-1,\delta} \left( \mathrm{low} + \mathrm{r} \times \mathrm{upp} \right) \left( \mathrm{P}\_{m}^{iter-1} \right) \right] + im\_{m}^{iter-1,\delta} \times \omega\_{\mathrm{im}} \times \\ \left[ \left( \frac{1}{pN} \sum\_{j=1}^{pN} \mathrm{P}\_{j}^{iter-1} \right) \times \left( \mathrm{P}^{iter-1} \right) \right] + roa m\_{m}^{iter-1,\delta} \times \omega\_{\mathrm{nom}} \times \delta \mathrm{P}^{iter-1} \end{aligned} \tag{40}$$

The velocity of the horses belonging to the 5–10-year age group is described as follows, and it is defined as γ:

$$\begin{split} \left. \text{Vol}\_{m}^{iter,\gamma} = \left[ \omega\_{\mathcal{S}} \times \mathcal{g}\_{m}^{iter-1,\gamma} (\text{low} + \text{r} \times \text{upp}) \left( P\_{m}^{iter-1} \right) \right] + h\_{m}^{iter-1,\gamma} \times \omega\_{h} \times \\ \left[ P\_{lbh}^{iter-1,\gamma} - P\_{m}^{iter-1} \right] \\ + \left. \text{osc}\_{m}^{iter-1,\gamma} \times \omega\_{\text{soc}} \times \left[ \frac{1}{N} \sum\_{j=1}^{N} P\_{j}^{iter-1,\gamma} - P^{iter-1} \right] \dot{m}\_{m}^{iter-1,\gamma} \times \omega\_{lm} \times \\ \left[ \left( \frac{1}{pN} \sum\_{j=1}^{pN} P\_{j}^{iter-1} \right) - P^{iter-1} \right] + \\ \text{roam}\_{m}^{iter-1,\gamma} \times \omega\_{roam} \times \delta P^{iter-1} \end{split} \tag{41}$$

The velocity of the horses belonging to the 5–10 year age group is described as follows, and it is defined as β.

$$\begin{split} \left[\text{eV}\right]\_{\text{m}}^{\text{iter},\mathfrak{H}} &= \left[\omega\_{\mathfrak{S}} \times g\_{\text{m}}^{\text{iter}-1,\mathfrak{f}} (\text{low} + \text{r} \times \text{upp}) \left(P\_{\text{m}}^{\text{iter}-1}\right)\right] + h\_{\text{m}}^{\text{iter}-1,\mathfrak{f}} \times \omega\_{\text{h}} \times \left[P\_{\text{lbh}}^{\text{iter}-1,\mathfrak{f}} - P\_{\text{m}}^{\text{iter}-1}\right] \\ &+ \text{soc}\_{\text{m}}^{\text{iter}-1,\mathfrak{f}} \times \omega\_{\text{soc}} \times \left[\frac{1}{N} \sum\_{j=1}^{N} P\_{j}^{\text{iter}-1,\mathfrak{f}} - P^{\text{iter}-1}\right] - \\ &\text{defensement}\_{\text{m}}^{\text{iter}-1,\mathfrak{f}} \times \omega\_{\text{defensement}} \times \\ &\left[\left(\frac{1}{\sqrt{N}} \sum\_{j=1}^{\mathfrak{N}} P\_{j}^{\text{iter}-1}\right) - P^{\text{iter}-1}\right] \end{split} \tag{42}$$

The velocity of the horses belonging to the >15 age group is described below, and it is defined as α.

$$\begin{split} \left[ \mathrm{Ver}\_{\mathrm{m}}^{\mathrm{iter},\mathrm{a}} = \left[ \omega\_{\mathcal{S}} - \mathrm{g}\_{\mathrm{m}}^{\mathrm{iter}-1,\mathrm{a}} (\mathrm{low} + \mathrm{r} \times \mathrm{upp}) \left( P\_{\mathrm{m}}^{\mathrm{iter}-1} \right) \right] - \mathrm{def} \mathrm{sem} \mathrm{sem} \mathrm{c}\_{\mathrm{m}}^{\mathrm{iter}-1,\mathrm{a}} \times \\ \omega\_{\mathrm{defensement}} \times \left[ \left( \frac{1}{\eta \mathrm{N}} \sum\_{j=1}^{\eta \mathrm{N}} P\_{j}^{\mathrm{iter}-1} \right) - P^{\mathrm{iter}-1} \right] \end{split} \tag{43}$$

From the above elaborative narration, the benefits of the horse herd optimization algorithm are summarized below:


The HHO algorithm is established to derive the best parameter value of AFOPID by minimizing the integral absolute error (IAE) and integral time absolute error (ITAE) objective functions.
