# Revised Gravitational Search Algorithms Based on Evolutionary-Fuzzy Systems
## 2 The Gravitational Search Algorithm
\[v_{i}^{d}(t+1)=rand_{i}\times v_{i}^{d}(t)+a_{i}^{d}(t) \tag{8}\]  
\[x_{i}^{d}(t+1)=x_{i}^{d}(t)+v_{i}^{d}(t+1) \tag{9}\]  
The gravitational and inertial masses are updated by the Equations (10)-(12), where \(fit_{i}(t)\) represents the fitness value of the agent \(i\) at time \(t\), and \(worst(t)\) and \(best(t)\) are defined as in (13) and (14) for minimization (maximization) problems. \[M_{ai}=M_{pi}=M_{ii}=M_{i},i=1,2,...,n \tag{10}\]  
\[a=\frac{F}{M} \tag{2}\]0  
\[a=\frac{F}{M} \tag{2}\]1  
\[a=\frac{F}{M} \tag{2}\]2  
\[a=\frac{F}{M} \tag{2}\]3  
In order to find a good compromise between exploration and exploitation, the number of agents with a lapse of time has to be reduced. To improve the performance of GSA by controlling exploration and exploitation, only the \(K_{best}\) agents will attract the others [22]. Therefore, Equation (6) can be rewritten as in (15):  
\[a=\frac{F}{M} \tag{2}\]4  
Algorithm 1 describes the gravitational search algorithm. **S1**. First of all, the algorithm initializes, in a random way, the position \(X\) of the agents in the search space. The initialization procedure depends on the number of agents \(n\), the dimension of the test functions \(r\) and the allowable range \([up,down]\) for the search space. The positions \(X\)'s are calculated by generating \(n\times r\) random numbers between 0 and 1 and normalizing them on the range \([up,down]\). In other terms, the positions are computed by the formula \(X(i,j)=rand(i,j)*(down-up)+down\), with \(i=1,...,n\) and \(j=1,...,r\). **S2**. Once the positions are generated, the algorithm computes the fitness of the agents for a certain function. In other words, the value of the objective function is computed. Note that the fitness depends on the position of the agents and the dimension of the function. **S3**. The value of the fitness is necessary to calculate the mass of each agent \(m_{i}(t)\) for \(i=1,2,...,n\). (see (11)). On the other hand, \(m_{i}(t)\) depends on \(best(t)\) and \(worst(t)\) (Equations (13) and (14), respectively), which also depend on fitness. Subsequently, the gravitational constant \(G(t)\), as defined in (5), is computed. **S4**. According to \(G(t)\), the total force in different directions is calculated. In particular, the algorithm computes the Euclidean distance between two agents \(R_{ij}(t)\) and the force acting on mass \(i\) from mass \(j\) at a specific time \(t\) (see (3)). Subsequently, the total force \(F_{i}^{d}(t)\) (see (6)) is computed. Therefore, the acceleration of the agents, their velocity and position at \(t\) time are calculated by means of (7), (8) and (9), respectively. **S5**. The steps from **S2-S4** are repeated until a certain number of iterations is reached. **3. The Evolutionary Fuzzy Algorithms**  
The first task of our study is the choice of the GSA parameter, which must be tuned. Because the gravitational constant \(G\) defined in (5) has a significant effect on the control of the exploration versus exploitation propensities of the particle swarm [25], the parameter \(\alpha\) of (5) is chosen. The adjusting of \(\alpha\) is accomplished through a fuzzy controller optimized by GA, PSO and DE. The first step to design a fuzzy controller is the definition of the fuzzy inputs and outputs. The number of fuzzy inputs and outputs depends on the specific problem. In this case, four fuzzy inputs are defined. The first input is the iteration number \(N=\{1,2,...,k\}\). Let \(P_{d}(i)\) be the population diversity at the \(i\)-th iteration, with \(i=1,...,k\); by considering the (4), the population diversity is defined as in (16), where \(R_{mean}(i)\), \(R_{min}(i)\), \(R_{max}(i)\) are the mean, min and max Euclidean distance between two agents, respectively. The population diversity is the main tool for monitoring the convergence rate of the algorithm, and it represents the second fuzzy input. \[a=\frac{F}{M} \tag{2}\]5  
Another important parameter for monitoring the convergence rate is the population progress at the \(i\)-th iteration denoted by \(P_{p}(i)\).