# Revised Gravitational Search Algorithms Based on Evolutionary-Fuzzy Systems
## 2 The Gravitational Search Algorithm
By considering the (13) and (14), the definition of \(P_{p}(i)\) is shown in (17), where \(fit_{mean}(i)\) is the fit mean value at the \(i\)-th iteration. \(P_{p}(i)\) is the third fuzzy input. \[a=\frac{F}{M} \tag{2}\]6  
The fourth fuzzy input \(\alpha(i-1)\) is the value of \(\alpha\) at the \((i-1)\)_th_ iteration. Because the parameter \(\alpha\) has to be tuned, the fuzzy output is the value \(\alpha(i)\), i.e., the value of \(\alpha\) at the \(i\)-th iteration. The next step is the choice of the number and shape of the membership functions. This choice depends on the specific problem, and sometimes, it is a trial and error procedure. By considering our problem, triangular/trapezoidal membership functions are chosen. The inputs \(N\), \(\alpha(t-1)\) and the output \(\alpha(t)\) have three membership functions: Low (L), Medium (M) and High (H). The other inputs have two membership functions: Low (L) and High (H). The ranges of \(\alpha\) are defined experimentally for each benchmark function, whereas the ranges of \(N\), \(P_{d}\) and \(P_{p}\) are the same for all of the test functions. The number of membership functions for each input defines the fuzzy rules number. Therefore, our rule set is composed of \(3\times 2\times 2\times 3=36\) rules (see Table 1). \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multicolumn{2}{c}{**Rule**} & \multicolumn{3}{c}{**Fuzzy Inputs**} & \multicolumn{2}{c}{**Fuzzy Output**} \\ \hline R & \(N\) & \(P_{d}\) & \(P_{p}\) & \(\alpha(i-1)\) & \(\alpha(i)\) \\ \hline  
\) & \(H\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Fuzzy rules. The rules shown in Table 1 are designed to prevent problems of being trapped in local optima and premature convergence. This fact justifies the dependance of the (16), (17) and \(\alpha\) from the number of iterations; in other terms, \(P_{d}=P_{d}(i)\), \(P_{p}=P_{p}(i)\) and \(\alpha=\alpha(i)\) with \(i=1,...,k\). All of the rules have been generated through knowledge. The presence of a lack of improvement when the number of iterations is low is a sign of being trapped in the local optimum and premature convergence. If the number of iterations is low and \(\alpha(i-1)\) is low, then \(\alpha(i)\) is set to low. In fact, when \(\alpha\) is low, the value of the gravitational constant \(G\) increases. Therefore, the acceleration and velocity of the agents increase, and the population can escape from being trapped in local optima. In the situations where the population diversity is low and the number of iterations is medium, a reduction of \(\alpha\) improves the diversity to achieve better solutions. In order to increase the power of exploitation of the algorithm, when the iteration number is high, the gravitational constant must decrease. Therefore, by increasing \(\alpha\), it follows that \(G\) decreases. If the algorithm is at the last iterations, there is a lack of improvement and the diversity is huge, the algorithm has failed the convergence target. In these situations, \(\alpha\) must be increased. Finally, all of the rules follow the knowledge described before. Our fuzzy system uses the Mamdani inference system, and the inputs are combined logically using the \(AND\) operator. The centroid is the used defuzzification method. In the evolutionary fuzzy systems, the membership functions' shapes can be evolved using a genetic algorithm [37]. [PERSON] et al. [38] proposed a real-coded GA, which simultaneously optimizes the parameters of the antecedent membership functions and the rule consequent. By following this way, we apply a suitable genetic algorithm to establish the best slopes of the triangular/trapezoidal membership functions. In order to achieve a good optimization, the optimization range for all of the membership functions has to be defined. The ranges are established avoiding possible crossings of more than two membership functions. The inputs \(N\), \(P_{d}\) and \(P_{p}\) have the same ranges for all of the simulations.