## 4 Cellular Bat Algorithm Based on Fuzzy Membership Degree
### Improved Cellular Bat Algorithm  
For the DERs aggregation model based on multi-scenario and multi-objective, this paper uses cellular bat algorithm based on fuzzy membership degree to solve it. Bat algorithm is a heuristic algorithm with good optimization characteristics. The principle of this algorithm is echolocation of the bat [24]. Compared with other heuristic algorithms, the cellular bat algorithm, which combines cellular automata with bat algorithm, has faster convergence speed and better global optimization ability. The optimal results obtained by this algorithm are the Pareto solution sets. In practical planning, only one planning scheme can be selected. Therefore, the optimal compromise solution can be selected according to the fuzzy membership degree [25]. **Definition 1**. : _Assume that the Euclidean space \(H_{N^{*}D}\) is the search space of the bat population, the location of the \(i\)-th bat is as follows:_  
\[U_{i}=\left\{u_{11},\ldots u_{ij},\ldots u_{iD}|u_{ij}\in[0,1]\right\} \tag{22}\]  
_where \(N\) is the total number of bats, \(D\) is the code length or the dimension, \(u_{ij}\) is the \(j\)-th code of the \(i\)-th bat location._  
**Definition 2**. : _The distance between the \(p\)-th and the \(q\)-th bats is expressed as follows:_  
\[\mathit{dis}(p,q)=\sum_{j=1}^{D}\left|u_{pj}-u_{qj}\right|\ \ \ \ p,q\in\{0,1, \ldots,N\} \tag{23}\]  
**Definition 3**. : \(U=(u_{1}\)_,...,\(u_{i}\)_,...,\(u_{D})\) is a set, where \(u_{i}\in\{0\), 1}, the arrangements of \(u_{i}\) constitute the cell space, which is recorded as \(L=\{\mathit{cellX}=(u_{1}\),...,\(u_{i}\),...,\(u_{D})|\)\(u_{i}\in\{0,1\}\), cellX is a cell composed of 0 and 1 arrays._  
**Definition 4**. : _Multi-dimensional cell neighborhood type: \(M=\{\mathit{cellY}\}\mathit{dis}(\mathit{cellY}\)-\(\mathit{cellX})\leq\)\(r\), cellX, cellY\(\in\)\(L\)\(\mathit{r}\) is the radius of the cellular neighbor, and \(r=1\) is chosen in this paper._  
**Definition 5**. : _Cell update rule: Determine the central cell and the neighbor cells according to the definition, calculate the target solution of the central cell and the neighbor cells, and select the cell corresponding to the optimal target solution._The steps of FMD-CBA are as follows:  
1. Initialize the parameters. Determine the bat population size \(N\), the location \(U_{i}^{0}\) of the \(i\)-th bat, the frequency \(\beta_{i}^{0}\), the velocity \(v_{i}^{0}\), and the pulse emission rate \(R_{i}^{0}\). The initial codes of the \(i\)-th bat position are calculated as follows: \[u_{ij}^{0}=\left\{ \begin{array}{l}1,rand()\geq 0.5\\ 0,rand()<0.5\end{array} \right.\] (24)
2. Calculate the objective function value corresponding to each bat in the population. 3. According to equations (25) and (26), update the speed of each bat in the population. The update formula of the bat location is as follows: \[\beta_{i}=\beta_{\min}+(\beta_{\max}-\beta_{\min})\gamma\] (25) \[v_{i}^{t+1}=v_{i}^{t}+(u_{i}^{t}-u_{op})\beta_{i}\] (26) \[u_{ij}^{t}=\left\{ \begin{array}{l}1,1/(e^{-v_{ij}^{t}}+1)\geq rand()\\ 0,1/(e^{-v_{ij}^{t}}+1)<rand()\end{array} \right.\] (27) where \(\beta_{i}\), \(\beta_{\min}\) and\(\beta_{\max}\) are the frequency, the minimum frequency and maximum frequency of the sound waves emitted of the \(i\)-th bat, \(\gamma\) is a random number between 0 and 1, \(u_{op}\) is the optimal location of the bat, \(u_{i}^{t}\) and \(v_{i}^{t}\) are the location and speed of the \(i\)-th bat in the \(t\)-th generation:
4. If rand()\(>\)\(R_{i}^{t}\), according to the definition of the multi-dimensional cell neighbor, update the cell in the neighbor range, and select the optimal solution \(u^{t+1}\) in the neighbor. If not, regard the central cell as the optimal solution \(u^{t+1}\), where \(R_{i}^{t}\) is the emission rate of the \(i\)-th bat in the \(t\)-th generation. 5. Calculate the objective function value \(f^{t+1}\) corresponding to the optimal solution \(u^{t+1}\).