## 4 Fuzzy Logic Controller Parameter Optimization Using Cuckoo Search Algorithm
### Levy Flights Random Walk  
After the initialization and with the information that possible good solutions were obtained in a previous generation, CS starts an intensification (local search) process so that better solutions can be obtained. CS intensification is carried out using a Levy flights random walk with a step-size drawn from a Levy distribution that is characterized by its infinite mean and variance, enabling CS to explore the search space more efficiently than other algorithms that use a standard Gaussian process. At a generation \(G>0\), a new solution is generated using a random walk according to the following expression [3; 29]:  
\[X_{MF(G+1)}=X_{MF(G)}+\alpha\cdot Levy(\beta) \tag{10}\]  
\[\alpha=\alpha_{0}\cdot\left(X_{MF(G)}-X_{MF(best)}\right) \tag{11}\]  
where \(X_{MF(G+1)}\) is a candidate new solution for MF's parameters obtained after the intensification process, \(X_{MF(G)}\) is a candidate solution at a previous generation \(G\) selected from the cuckoo population, \(\alpha>0\) is a set of step-sizes that are related to the scale of the problem [3; 29], \(Levy(\beta)\) is a set of random numbers drawn from a Levy distribution, \(X_{MF(best)}\) is the best solution for MF's parameters obtained so far in the iterative process and together with RB parameters, better optimizes the objective function, and \(\alpha_{0}\) is a scaling factor that generally is fixed and set to 0.001 or 0.1 although a varying scaling factor has shown better performance for most optimization problems [48]. In the present work, a varying scaling factor drawn from a uniform distribution is employed and formulated as follows:  
\[\alpha_{0}\sim U(0.01,0.1) \tag{12}\]  
In the implementation, Levy flights are calculated via the so-called [PERSON]'s algorithm for a symmetric Levy stable distribution, as follows [3; 29].  
\[Levy\ (\beta)=\frac{\phi\cdot w}{|v|^{1/\beta}} \tag{13}\]  
\[\phi=\left[\frac{\Gamma(1+\beta)\cdot\sin\left(\frac{n\cdot\beta}{2}\right)}{ \Gamma\left(\frac{1+\beta}{2}\cdot\beta\cdot 2^{\frac{n-1}{2}}\right)} \right]^{1/\beta} \tag{14}\]  
where \(\beta=1.5\) is the constant of the Levy distribution [3], \(w\) and \(v\) are random numbers drawn from a normal distribution with zero mean and unit standard deviation, and \(\Gamma\) is the gamma function [3; 29; 49].  
It is worth pointing out that the aforementioned procedure is applied only to generate new solutions for the MF's mapping. Therefore, new solutions for the RB are calculated as follows.  
\[X_{RB(G+1)}=X_{RB(G)}+S\cdot\left(X_{RB(G)}-X_{RB(best)}\right) \tag{15}\]  
where \(X_{RB(G+1)}\) is a candidate new solution for RB parameters obtained after the intensification process, \(X_{RB(G)}\) is a candidate solution at a previous generation \(G\) selected from the cuckoo population, \(S\) is set of integer numbers drawn from a normal standard distribution \(N\) (0, 1) to displace the RB values, and \(X_{RB(best)}\) is the best solution for RB parameters obtained so far in the iterative process and together with membership function's parameters, better optimizes the objective function.  
It is worth pointing out that intensification is applied to every solution of the population and a solution is replaced by another one or carried through the next generations, according to the following expression:  
\[X_{G+1}=\left\{\begin{array}{ll}X_{G+1};&O(X_{G+1})<O(X_{G})\\ X_{G};&otherwise\end{array}\right. \tag{16}\]  
where \(O\) (\(X\)) is the objective of optimization function, and \(X_{G}\)/\(X_{G+1}\) are candidate solutions comprising of \(X_{MF(G)}\)/\(X_{MF(G+1)}\) and \(X_{RB(G)}\)/\(X_{RB(G+1)}\), respectively.