*2.2. Proposed Algorithm*

The created input dataset contains (*x* − 1), (*x* − 2), (*x* − 3), (*x* − 4), (*x* − 5), (*x* − 6), (*x* − 24), (*x* − 25), (*x* − 26), (*x* − 27), (*x* − 28), (*x* − 29), (*x* − 30) variables where *x* is the actual electrical power demand. These are the inputs of the NSGA II which can generate results with any given input dataset and find the best combination of the inputs. Thus, other delays of the electrical power demand and weather parameters (if available) can be added to the inputs.

The proposed algorithm is a two-step forecasting process. In the primary forecasting step, a combination of the NSGAII and MLPNN was employed. MLPNN is the fitness function of the NSGA II to determine fitness of the input combinations in each iteration of the NSGAII. The output of the NSGAII was set to be the MLPNN with the best fitness. Therefore, the obtained MLPNN contains the best combination of the input variables among tested combinations in iterations of the NSGAII and is also the best-trained neural network.

As the second step, the obtained forecasted value from the first step was fed to the ANFIS. The result of this step is the final forecasted value of the electrical energy demand. Training of the ANFIS was realized using different algorithms, namely hybrid algorithm (combination of the backpropagation and least-square error), ACO, DE, GA, ICA, and PSO. Among applied algorithms for ANFIS training, GA demonstrated better performance in terms of the lower values of error indicators. The overall proposed approach is presented in Figure 3.

**Figure 3.** Proposed algorithm.
