## 2 Literature Review
### ANFIS and Multilayer FNN (MFNN) Models and Optimization Algorithms  
While the ANFIS model has a good ability to obtain the output from the inputs as a soft computing model, a long and complex computation process is required to find the best values of the consequent and MF (membership function) parameters. The MFNN model has a few unknown components: number of neurons in the hidden layer weights, biases, and activation functions (either per layer or per neuron). Thus, the optimization algorithms are used for computing ANFIS and MFNN parameters. A comprehensive explanation is presented for each algorithm based on the following parts:  
1. Bat algorithm (BA): BA is an optimization algorithm that acts based on echolocation characteristics. Each of the flying bats has a random velocity and flies at random positions. When it is searching for prey, its loudness, frequency, and pulsation rates are widely varied. A local random walk is used to increase the search ability [26]. The velocity and position components are used to obtain the optimal solutions. Each position is a candidate solution. Thus, the best position is the best solution while the algorithm should avoid trapping in the local optimums (Figure 6). In fact, bats generate sounds that are returned from the surroundings. They can differentiate an obstacle from prey based on returned frequencies [26]. The velocity, frequency, and position are defined as: \[f_{l}=f_{\min}+(f_{\max}-f_{\min})\times\beta,\] (7) \[v_{l}(t)=[x_{l}(t)-x_{*}]\times f_{l},\] (8) \[x_{l}(t)=x_{l}(t-1)+v_{l}(t),\] (9) where \(f_{l}\) is frequency, \(f_{\min}\) is minimum frequency, \(f_{\max}\) is maximum frequency, \(v_{l}(t)\) is velocity, \(x_{l}(t)\) is position, and \(x_{*}\) is the best position. Equation (9) defines the local search applying a random walk [30]: \[x(t)=x(t-1)+\varepsilon A_{t},\] (10) where \(A_{t}\) is loudness and \(\varepsilon\) is a random value. The pulsation and loudness rate are varied during computational levels. If a bat finds its prey, the pulsation (\(r_{l}\)) and loudness rate have an increasing and decreasing trend, respectively. The quality solutions are identified by the objective function computation (Figure 6). 2. Weed algorithm (WA): Weeds attempt to find the best growth position. Among all the characteristics of this optimization algorithm, its easy structure, high accuracy, and few random parameters make it useful for practice in optimization problems. WA has different levels as follows [27]:
* Initialization: The initial population is distributed randomly in a d dimensional problem space. The locations of weeds are considered as the decision-making components. * Reproduction: The weeds generate a particular number of seeds. The number of seeds varies from S\({}_{\min}\) (minimum number of seeds) to S\({}_{\max}\) (maximum number of seeds). The number of seeds is \(S_{\max}\) if a weed has the best objective function value. Although the quality of some weeds is not good, the reproduction process allows them to have a chance again for continuation of life. This issue is important because some of them may have important information. If they do not have another chance, important information is eliminated from the algorithm cycle. * Competitive level: The combination of weeds produces the next weed generation. If the population exceeds a threshold, the weeds with low quality are eliminated compared to weeds with high quality. * Termination level: The algorithm finishes when the number of algorithm levels of iteration (Iter) reaches the maximum number of iterations (iter-max), which has been proposed to be 1000 iterations. (Figure 7). Figure 6: Structure of the bat algorithm (BA). Figure 8 shows the simulation process based on the ANFIS and optimization algorithms. Figure 8: ANFIS and optimization algorithm. Figure 7: Structure of the weed algorithm (WA). The following indices are used to evaluate different models [31; 32]:  
1.