## 2 Materials and Methods
### Two-Level System of Multi-Objective Genetic Algorithms
#### 2.3.2 Level 2: Multi-Objective GA for Measuring the Forecasting Accuracy  
In this level, the multi-objective GA is applied longitudinally to the data. The multi-objective GA operates with a population of chromosomes that contains labour cost and material cost objects. The GA operates on the selected population over different generations to find the appropriate forecasting accuracy. During the GA generations, the chromosomes in the population are rated concerning their adaptation, and their mechanism of selection for the new population is evaluated. Their adaptability (fitness function) is the basis for a new population of chromosomes. The new population is formed using specific genetic operators such as crossover and mutation. The multi-objective GA is used to evaluate the forecasting accuracy for each generation of the first level. Level 2 utilises a multi-objective GA which is based on different forecasting error rates and is implemented for each generation from the first level and for four different populations using a cross-validation randomization technique. This technique aims to select the best evaluation of the time series data forecasting and the process is as follows. A random number of cost data are selected based on the encoding in each generation of the four implementations, and the modified random cost data are generated five times. The modifications are then used to find the optimal cost data forecasting. In this study, due to the size of the training data, five generations are sufficient to obtain valid results. The following steps are implemented when applying the multi-objective GA in level 2. Step 1: Initial population  
A longitudinal study is performed of each generation and each cost object (\(Z^{labour}\), \(Z^{material}\)) with its forecasted data using the multi-objective GA in parallel. Step 2: First GA generation, encoding and selection  
The first generation is performed by selecting each cost object and encoding through generating random values, either ones or zeros, for each cost data object. The selection for each cost data object is based on encodings with the value of 1. This selection is used to evaluate the forecasted data using the multi-objective fitness function. Step 3: Fitness function  
The multi-objective fitness function is based on multiple functions for measuring the forecasting accuracy. The mean absolute percentage error (MAPE), the median absolute percentage error (MdAPE), the root mean square percentage error (RMSPE), the root median square percentage error (RMdSPE), and the mean absolute scaled error (MASE) are different fitness functions used to evaluate the selected forecasting data from the previous step. The fitness functions are formulated as follows in the Equations (5)-(9) [23]:  
\[fitness(MAPE)=mean(|p_{t}|) \tag{5}\]  
where \(p_{t}=\frac{100\epsilon_{t}}{Y_{i}}\) and \(e_{t}=Y_{t}-F_{t}\)  
\[fitness(MdAPE)=median(|p_{t}|) \tag{6}\]  
where \(p_{t}=\frac{100\epsilon_{t}}{Y_{i}}\) and \(e_{t}=Y_{t}-F_{t}\),  
\[fitness(RMSPE)=\sqrt{mean\big{(}p_{t}^{2}\big{)}} \tag{7}\]  
where \(p_{t}=\frac{100\epsilon_{t}}{Y_{i}}\) and \(e_{t}=Y_{t}-F_{t}\)  
\[fitness(RMdSPE)=\sqrt{median\big{(}p_{t}^{2}\big{)}} \tag{8}\]  
where \(p_{t}=\frac{100\epsilon_{t}}{Y_{i}}\) and \(e_{t}=Y_{t}-F_{t}\)  
\[fitness(MASE)=mean(|q_{t}|) \tag{9}\]  
where \(q_{t}=\frac{e_{t}}{\frac{1}{n-1}\sum_{i=2}^{n}|Y_{i}-Y_{i-1}|}\), where \(e_{t}=Y_{t}-F_{t}\);  
In the above equations, the following notation is used:  
\(t\): time \(\{1,\dots,k\}\);  
\(Y_{t}\): the actual data over time;  
\(F_{t}\): the forecasted data over time. The MAPE is often substantially larger than the MdAPE when the data involve small counts. In this study, it was impossible to use these measures since zero values of \(Y_{l}\) frequently occurred. The RMSPE and RMdSPE are more sensitive to the data. These methods are examples of a random walk and measure the accuracy based on the last adjusted observation of forecasted seasonality. The MASE is a scaled measure based on relative errors.