## 4 Methods
### Fully-Self-Adaptive Harmony Search (FSHS) Algorithm
#### 4.1.1 Variable-Size Harmony Memory  
In the main HS, the harmony memory size is considered constant. It leads to the use of all of the memory solutions in producing new harmonies. Although this increases the diversity in the production of new harmonies in the initial iterations, it slows down the convergence rate in the final iterations [40].  
Figure 1: Full-Self-Adaptive Harmony Search (FSHS) algorithm.  
We used a variable-size memory in the proposed method to address the problem, as shown in Equation (9):  
\[\text{HMS}_{\text{g}}=\left\lceil\left(1-\left(\frac{0.9}{\text{NI}}\times\text{ g}\right)^{2}\right)\times\text{HMS}_{\text{max}}\right\rceil \tag{9}\]  
where \(\text{HMS}_{\text{g}}\) is the harmony memory size in generation g; \(\text{HMS}_{\text{max}}\) is the maximum size of harmony memory; NI is the number of iterations in the algorithm; and g is the desired generation.  
As all of the memory harmonies are used at the beginning of the search and during the searches' progress, the number of harmonies will decrease gradually. Lower-quality harmonies are not physically removed from the harmony memory and are utilized in the random selection step. In the initial iterations of this strategy, using all of the harmonies in the memory leads to maintenance of the ability of the algorithm to keep the diversity by generating various harmonies. Besides, the intensification increases in the final iterations by focusing on the best harmonies. Moreover, as a result of increasing the diversity in the production of a new solution and increasing the algorithm's capability in the global search in the proposed method, instead of using the values of the same decision variable, all of the decision variables values are used after selecting a harmony from the memory. A similar method is used in GHS [41] and IGHS [42]. However, this process is completed in the Pitch Adjustment section and only the values of the decision variables of the best harmony are used. Although this method greatly increases the convergence rate in the initial iterations, it reduces the exploitation ability of the algorithm from the middle iterations onwards.  
Hence, if the optimal values of the variables are not a close decision, selecting the values of other variables prevents convergence in the final iterations [42]. Therefore, a reduction mechanism is utilized in the FSHS to use the values of the other decision variables for solving the problems (Equations (10)-(12)):  
\[\mu=\left\lceil\left(1-\left(\frac{0.9}{\text{NI}}\times\text{g}\right) \right)\times\text{N}\right\rceil \tag{10}\]  
\[\text{S}^{\mu}\subset\text{X}^{\text{i}}\text{, where }\text{X}^{\text{i}}=\left\{\text{x}^{ \text{i}}_{1},\text{x}^{\text{i}}_{2},\text{x}^{\text{i}}_{3},\ldots,\text{x} ^{\text{i}}_{\text{N}}\right\}\text{and i}=\text{U}(1,\text{HMS}_{\text{g}}) \tag{11}\]  
\[\text{X}^{\text{new}}_{\text{j}}=\text{X}^{\text{i}}_{\text{k}}\text{, where }\text{X}^{\text{i}}_{\text{k}}\in\text{S}^{\mu}\text{ and k}=\text{U}(1,\mu) \tag{12}\]  
where \(\text{S}^{\mu}\) is a randomly selected of the harmony decision variables set which includes \(\mu\) members; \(\text{X}^{\text{i}}\) and k is an integer random number between 1 and \(\mu\); and the decision variable \(\text{X}^{\text{i}}_{\text{k}}\) is a member of the \(\text{S}^{\mu}\). In other words, there is a variety of choice for the values in the initial iterations. From the middle iterations onwards, the focus is on the values of the same decision variables.