# Joints Trajectory Planning of Robot Based on Slime Mould Whale Optimization Algorithm
## 2 WOA and SMA  
### [PERSON] et al. [28] studied the bubble net predation method of humpback whales. A whale optimization algorithm (WOA) was proposed based on this spiral bubble net attack mechanism. Individual whales constantly update their positions to approach prey with different mechanisms, including encirclement, spiral bubble-net feeding manoeuvre and a global exploration phase. The mathematical model of the three parts is as follows. (1) Encircling prey  
Suppose that the number of whale populations participating in the predation is \(N\), and the dimension of the explored space is \(d\). The position of the \(i\)th whale in the \(d\)-dimensional space at the \(t\)th iteration is expressed as:  
\[\mathbf{X}_{nt}=(X_{n1},X_{n2},\ldots,X_{ntd}),n=1,2,\ldots,N \tag{1}\]  
The optimal position to date is denoted as the prey position, which is defined as:  
\[\mathbf{X}^{\Delta}=(X_{1}^{\Delta},X_{2}^{\Delta},\ldots,X_{d}^{\Delta}) \tag{2}\]  
As the number of iterations increases, the optimal position is gradually updated and replaced. Because the initial population has no prior experience, whales initially choose random individual locations as their search targets. The process of searching and encircling prey can be expressed as:  
\[\mathbf{X}_{n(t+1)}=\mathbf{X}_{t}^{\Delta}-\mathbf{A}\cdot\mathbf{D} \tag{3}\]  
where \(\mathbf{A}\) is the coefficient vector. \(\mathbf{D}\) is the distance between the current individual and the current optimal individual, that is, the bounding step size, which is expressed as follows:  
\[\left\{ \begin{array}{l}\mathbf{A}=2\mathbf{a}\cdot\mathbf{r}_{rand}-\mathbf{a}\\ \mathbf{D}=\left|2\mathbf{r}_{rand}\cdot\mathbf{X}_{t}^{\Delta}-\mathbf{X}_{t}\right|\end{array} \right. \tag{4}\]  
where \(\mathbf{a}\) is the convergence factor, whose element \(a=2-2t/t_{\text{max}}\), which decreases linearly from 2 to 0 as the number of iterations increases. \(\mathbf{r}_{rand}\) is a random vector of [0, 1]. (2) Spiral bubble-net feeding manoeuvre  
When the humpback whales are swimming around the prey, they are also performing spiral motion predation. This behaviour is called spiral bubble-net predation. The mathematical model of this process can be expressed as:  
\[\left\{ \begin{array}{l}\mathbf{X}_{n(t+1)}=\mathbf{X}_{t}^{\Delta}+\mathbf{D}^{\prime} \cdot e^{bl}\cdot\cos(2\pi l)\\ \mathbf{D}^{\prime}=\left|\mathbf{X}_{t}^{\Delta}-\mathbf{X}_{t}\right|\end{array} \right. \tag{5}\]  
where \(\mathbf{D}^{\prime}\) is the distance between the current individual and the optimal individual in the \(t\)th iteration. \(b\) is the constant defining the logarithmic spiral shape. \(l\) is the random number between [\(-1\),\(1\)]. Both mechanisms above belong to the development phase in the meta-heuristic optimization algorithm, in which the humpback whale keeps narrowing its range of movement and does spiral hunting at the same time. Assuming that the probability \(P\) of individual whales of two mechanisms is the same, that is, 50% for each, the mathematical model of these two approaches can be written as follows:  
\[\left\{ \begin{array}{l}\mathbf{X}_{n(t+1)}=\mathbf{X}_{t}^{\Delta}-\mathbf{A} \cdot\mathbf{D},\qquad\qquad P<0.5\\ \mathbf{X}_{n(t+1)}=\mathbf{X}_{t}^{\Delta}+\mathbf{D}^{\prime}\cdot e^{bl}\cdot \cos(2\pi l),P\geq 0.5\end{array} \right. \tag{6}\]
3. Global exploration phase This stage simulates the process that whale individuals search for food randomly according to mutual position. The mathematical model of this process can be expressed as Equation (7). \[\left\{ \begin{array}{l}\mathbf{X}_{n(t+1)}=\mathbf{X}_{t}^{\prime}-\mathbf{A} \cdot\mathbf{D}^{\prime}\\ \mathbf{D}^{\prime\prime}=\left|\mathbf{2r}_{nnd}\cdot\mathbf{X}_{t}^{\prime}-\mathbf{ X}_{nt}\right|\end{array} \right. \tag{7}\]  
where \(\mathbf{X}_{t}{}^{\prime}\) is the whale individual position randomly selected. \(\mathbf{D}^{\prime\prime}\) are the distances between the current individual \(\mathbf{X}_{tt}\) and the random individual \(\mathbf{X}_{t}{}^{\prime}\) in the \(t\)th iteration.