## 4 Design of a Self-Adaptive Evolutionary Algorithm
### Parent Selection Procedure  
Once SAEA enters the main loop, it deploys the parent selection procedure to determine the chromosomes that will participate in the SAEA operations and produce the offspring in a given generation. A Roulette Wheel Selection, which has been widely used in canonical Genetic Algorithms and Genetic Programming [20], will be adopted in this study at the parent selection stage. Based on the Roulette Wheel Selection (RWS) mechanism, each individual in the population is assigned a portion of a roulette wheel. A larger portion of the roulette wheel will be assigned to the fittest individual (i.e., the individual with lower objective function value, since the proposed **BSPSR** mathematical model aims to minimize the total weighted vessel turnaround time and the total weighted vessel late departures). The roulette wheel is continuously rotated, and one individual is selected at each rotation. The chance of a given individual to be selected is proportional to its fitness. The main steps of the RWS mechanism are outlined in Algorithm 2.  
```
1:\(\textit{RWS}(Pop_{g},Fit_{g})\)
2:\(Pop_{g}\)--population in generation \(g\); \(Fit_{g}\)--fitness of chromosomes in generation \(g\)
3:\(\textit{Parent}_{g}\)--parent chromosomes in generation \(g\)
4:\(\textit{Parent}_{g}|\leftarrow\oslash\); \(\textit{Fit}_{g}^{aux}|\leftarrow\lvert Pop_{g}\rvert\); \(\lvert\overline{Fit}_{g}^{aux}\rvert\leftarrow\lvert Pop_{g}\rvert\)\(\lash\) Initialization
5:\(q\gets 1\)
6:while\(q\leq\lvert Pop_{g}\rvert\)do
7:\(Fit_{qg}^{aux}\gets 1/Fit_{qg}\)\(\lash\) Adjust the fitness value of a given chromosome
8:\(q\gets q+1\)
9:endwhile
10:\(\overline{Fit}_{g}^{aux}\leftarrow\textit{Normalize}(Fit_{g}^{aux})\)\(\lash\) Normalize the adjusted fitness values of the population chromosomes
11:while\(\textit{Parent}_{g}|<\lvert Pop_{g}\rvert\)do
12:\(\textit{Val}\leftarrow\textit{Rand}(0.00;1.00)\)\(\lash\) Generate a random value between 0.00 and 1.00
13:\(i\leftarrow\textit{find}(\overline{Fit}_{g}^{aux}-Val>0)\)\(\lash\) Select the individual based on a randomly generated value
14:\(\textit{Parent}_{g}\leftarrow\textit{Parent}_{g}\cup\{Pop_{ig}\}\)\(\lash\) The selected individual is added to the set of parent chromosomes
15:endwhile
16:return\(\textit{Parent}_{g}\)
```  
**Algorithm 2**Roulette Wheel Selection (RWS).  
The data structures, required by the RWS mechanism, are initialized in step 0. Then, the fitness values of the population chromosomes are adjusted (i.e., \(Fit_{g}^{aux}\) values are estimated) in steps 2-5, as the **BSPSR** mathematical model has a minimization objective function. The adjusted fitness values of the population chromosomes are normalized in step 6 (so, the cumulative population fitness after normalization will be equal to 1.00). After that, RWS starts an iterative procedure (steps 7-11), where a random value between 0.00 and 1.00 is generated in step 8 (i.e., the roulette wheel is rotated). Then, the individual with a normalized fitness value, which is close to the randomly generated value, is selected to become a parent (steps 9 and 10). An iterative procedure is terminated by RWS once the required amount of parent chromosomes has been selected.