# Revised Gravitational Search Algorithms Based on Evolutionary-Fuzzy Systems
## 2 The Gravitational Search Algorithm
The whole range of the iteration number \(N\) is \([0,1000]\) (i.e., \(k=1000\)), whereas the population diversity \(P_{d}\) and population progress \(P_{p}\) are normalized in \([0,1]\). On the contrary, the optimization intervals of the \(\alpha\) membership functions are determined empirically for each benchmark function. In this work, we consider real-coded GAs [39] because binary coded or classical GAs [40] are less efficient when applied to multidimensional, high-precision or continuous problems. In fact, the bit strings can become very long, and the search space blows up. A serious problem of the genetic algorithms' design is the definition of the fitness function [41]. Bad fitness functions can easily make the algorithm get trapped in a local optimum solution and lose the discovery power. [PERSON] et al. [42] presented a specific varying fitness function technique that incorporates the problem's constraints into the fitness function in a dynamic way. However, our evaluation of the fitness functions is based on two features: efficiency and precision. Good fitness functions help the algorithm to explore the search space more effectively and efficiently. In order to assure such features, the fitness function \(f(x)\) shown in (18) is defined. \[f(x)=\frac{1}{1+exp(\sqrt[4]{x})}; \tag{18}\]  
In Equation (18), the variable \(x\) represents the best so far solution [22] to the iteration number \(k=1000\). The genetic algorithm searches the value of \(x\) that maximizes the fitness Function (18). Such a value of \(x\) will be as small as possible. The slope of the membership functions is adjusted until the optimal value of (18) is achieved. The genetic algorithms are characterized by three genetic procedures: selection, crossover and mutation. Among the various selection methods, we choose the roulette wheel selection method [43]. In roulette wheel selection, the probability that individual \(i\) is selected, \(P(I=i)\), is computed by Equation (19), where \(l\) is the population number. \[P(I=i)=\frac{f_{i}(x)}{\sum_{j=1}^{l}f_{j}(x)}; \tag{19}\]  
Algorithm 2 implements the roulette wheel selection. ```
1:For each individual \(i\), with \(i=1,2,...,l\):
2:Generate a random number \(r\) between 0 and 1. 3:Initialize the variables \(sum\) to 0 and \(j\) to 1. 4:If \(sum\geq r\) go to \(\mathbf{S.1.4}\). 5:Compute \(sum=sum+P(I=i)\), where \(P(I=i)\) is defined in (19). 6:Increment \(j\). 7:Go to Step \(\mathbf{S1.3}\). 8:Set \(parent(i)=par(j-1)\), i.e., establish the \(i\)-th parent parent from the \((j-1)\)-th value of the parameter \(par\). 9:Print the values of the parents. ```  
**Algorithm 2**  
In order to improve the convergence of the GA, we consider the elitism procedure [44]. It is an addition to many selection methods that forces the GA to retain some number of the best individuals at each generation. Some studies [45; 46] show that elitism can increase the performance of GA by preventing the loss of good solutions once they are found. Another genetic procedure is the crossover. The crossover recombines genetic material of parent chromosomes to produce offspring on the basis of crossover probability [47]. Given the mutations number \(nnutation\), the number of elitism \(nelt\), the number of the population \(l\) and the parents \(parent(i)\) (\(i=1,...,l\)), the designed crossover algorithm follows the steps of Algorithm 3. ```
1:For all \(j\) from 1 to \(\left\lfloor\frac{l-nnutation-nelt}{2}\right\rfloor\):
2:Compute a random number \(t\) between \(-0.25\) and \(1.25\)
3:Compute the parameters \(p(2j-1)=t\cdot parent(2j-1)+(1-t)\cdot parent(2j)\) and \(p(2j)=t\cdot parent(2j)+(1-t)\cdot parent(2j-1)\). 4:Print the parameters \(p\)
```  
**Algorithm 3**  
The mutation is a genetic operation that occasionally breaks one or more members of a population out of a local minimum/maximum space and potentially discovers a better minimum/maximum space [44]. Algorithm 4 describes the mutation algorithm, where the mutations number \(nnutation\) and the random mutations number \(nnutationR\)[41; 43] are given.