## 2 Materials and Methods
### Methodology
#### 2.6.2 The Global and Local Models
**Input**: \(ND\), population size of the dynamic ensemble of surrogates; DB, database;  
**Output**: the dynamic ensemble of surrogates;  
1: Apply \(k\)-fold cross validation (fivefold cross-validation is adopted in this paper) to \(ND\) best samples in the DB and build a pool of different single surrogate models (denoted as \(\mathcal{M}_{pool}\));  
2: Compute the error metrics (\(R^{2}\) and \(NRMSE\)) of these surrogates according to Equations (11) and (12);  
3: Sort the \(R^{2}\) and \(NRMSE\) of these surrogates in ascending order and add the corresponding indices;  
4: Add the \(R^{2}\) and the \(NRMSE\) indices for each surrogate together to obtain the final ranking indicator for all surrogates (denoted as \(\mathcal{M}_{sort}\));  
5: if \(find\) (\(\mathcal{M}_{sort}=2\)) is not empty, then  
6: Remove the other surrogates from \(\mathcal{M}_{pool}\) and then use the single surrogate model with the ranking indicator of 2;  
7:else\(find\) (\(\mathcal{M}_{sort}=3\)) is not empty  
8: if there are two surrogates with the ranking indicator of 3, then  
9: Remove the other surrogate from \(\mathcal{M}_{pool}\) and formulate the two surrogates with the ranking indicator of 3 into an ensemble surrogate using the UES;  
10: end if  
11:else  
12: Formulate the three surrogates into an ensemble surrogate using the UES;  
13:endif  
**Algorithm 2** Pseudocode for the dynamic ensemble of surrogates  
**Input**: \(ND\), population size of the dynamic ensemble of surrogates; DB, database;  
**Output**: the dynamic ensemble of surrogates;  
1: Apply \(k\)-fold cross validation (fivefold cross-validation is adopted in this paper) to \(ND\) best samples in the DB and build a pool of different single surrogate models (denoted as \(\mathcal{M}_{pool}\));  
2: Compute the error metrics (\(R^{2}\) and \(NRMSE\)) of these surrogates according to Equations (11) and (12);  
3: Sort the \(R^{2}\) and \(NRMSE\) of these surrogates in ascending order and add the corresponding indices;  
4: Add the \(R^{2}\) and the \(NRMSE\) indices for each surrogate together to obtain the final ranking indicator for all surrogates (denoted as \(\mathcal{M}_{sort}\));  
5: if \(find\) (\(\mathcal{M}_{sort}=2\)) is not empty, then  
6: Remove the other surrogates from \(\mathcal{M}_{pool}\) and then use the single surrogate model with the ranking indicator of 2;  
7:else\(find\) (\(\mathcal{M}_{sort}=3\)) is not empty  
8: if there are two surrogates with the ranking indicator of 3, then  
9: Remove the other surrogate from \(\mathcal{M}_{pool}\) and formulate the two surrogates with the ranking indicator of 3 into an ensemble surrogate using the UES;  
10: end if  
11:else  
12: Formulate the three surrogates into an ensemble surrogate using the UES;  
13:endif  
**Algorithm 3** Pseudocode for multi-tasking optimization  
**Output**: the \(n+1\) optimal solutions of surrogate models;  
1: Apply Algorithm 4 to generate the evolutionary population and let \(k=0\);  
2: Predict the fitness of each individual in \(N_{p}\) with the RBF surrogates and the ensemble surrogate;  
3: Compute the skill factor (\(\tau\)) of each individual;  
4:while\(k<k_{max}\),do  
5: Randomize the individuals in \(N_{p}\);  
6:for\(i=1\) to \(NP/2\),do  
7: Select two parent candidates \(p_{i}\) and \(p_{i+NP/2}\) from \(N_{p}\);  
8: Generate a random number \(r_{1}\), \(r_{2}\), and \(r_{3}\) between 0 and 1;  
9:if\(\tau_{i}=\tau_{i+NP/2}\) or \(r_{1}<mp\),then  
10: Parents \(p_{i}\) and \(p_{i+NP/2}\) crossover to give two offspring individuals \(c_{i}\) and \(c_{i+NP/2}\);  
11:else  
12: Mutate parent \(p_{i}\) slightly to give an offspring \(c_{i}\).