# A New Fuzzy Harmony Search Algorithm Using Fuzzy Logic for Dynamic Parameter Adaptation
## 2 Methodology for Parameter Adaptation
If a low percentage of iterations elapses, the _HMR_ and _PArate_ parameters would take a low value in the range in order to enable a wide search in the search space, as a kind of exploration. On the contrary, if a high percentage of iterations have occurred, it would give the _HMR_ and _PArate_ parameters a high value in the indicated range in order to draw a more intense exploitation within the search space in advanced iterations. Subsequently, if the percentage of elapsed iterations is medium, then a medium value for _HMR_ and _PArate_ would occur, with the aim of expanding the above criteria. The following equation represents this idea [27]:  
\[\text{Iteration}=\text{  
The design of the input variable in all fuzzy systems can be found in Figure 2, which shows the input called \"iteration\", and this input is granulated into three triangular membership functions. For the output variables, as mentioned above, the recommended values for _HMR_ and _PArate_ are from 0 to 1 and 0.7 to 1, so the output variables are designed using these ranges of values. Each output  
Figure 1: Proposal for fuzzy dynamic adaptation of HS. Figure 2: Input 1: Iteration. is granulated into three triangular membership functions which are low, medium and high, and the design of the _HMR_ and _PArate_ output variables can be found in Figures 3 and 4. Having defined the possible output variables, it was decided to combine them to generate different fuzzy systems for the dynamic adjustment of _HMR_ and _PArate_. Based on the literature the recommended values for the parameters are from 0 to 1, so in this case the range 0 to 1 and 0.7 to 1 were used for the outputs in the fuzzy system. There are 12 possible fuzzy systems, in this case only the three fuzzy systems using a range 0.7 to 1 are presented, using rules to increase because these algorithms achieve better results, which are defined below. The first fuzzy system has iteration as input and _HMR as_ output, which is shown in Figure 5. The second fuzzy system has iteration as input and _PArate_ as output and is shown in Figure 6. The third fuzzy system has iteration as input and the outputs are _HMR_ and _PArate_, as shown in \[x_{new}=x_{old}+b_{p}\left(2\;rand-\;1\right) \tag{2}\]0  
The first fuzzy system is defined by the following design, using as input the iterations and as output in this case the harmony memory accepting (_HMR_) to dynamically vary the first parameter that within the algorithm represents the exploitation, which is the number of solutions that will be considered for the subsequent iteration, as shown in \[x_{new}=x_{old}+b_{p}\left(2\;rand-\;1\right) \tag{2}\]1  
\[x_{new}=x_{old}+b_{p}\left(2\;rand-\;1\right) \tag{2}\]2 Output of Fuzzy System 2: _PArate_ (Pitch Adjustment Parameter). \[x_{new}=x_{old}+b_{p}\left(2\;rand-\;1\right) \tag{2}\]3 Output of Fuzzy System 1: _HMR_ (Harmony Memory Accepting Parameter). The second fuzzy system is defined by the following design, using as input the iterations and as output the pitch adjusting (_PArate_) to dynamically vary the second parameter that represents the exploration in the algorithm, which can be viewed as a refinement of local solutions, as shown in \[x_{new}=x_{old}+b_{p}\left(2\;rand-\;1\right) \tag{2}\]4  
The third fuzzy system, which is composed of the following design, uses as input the iterations and as outputs the _HMR_ and _PArate_ parameters to move both parameters dynamically. For this case, a combination of rules based on the results of the two previous fuzzy systems is made, as illustrated in \[x_{new}=x_{old}+b_{p}\left(2\;rand-\;1\right) \tag{2}\]5  
To design the rules of each fuzzy system, it was decided that in early iterations the HS algorithm must explore and eventually exploit. The rules for the fuzzy system number 1 are shown in Figures 8 and 9, the rules for the fuzzy system number 2 are shown in Figures 10 and 11 and the rules for the fuzzy system number 3 are shown in Figures 12 and 13, respectively.