## 2 Materials and Methods
### Study Protocol  
Each record from the study's dataset has three defined columns (two attributes and the outcome variable). The two attributes are: the tiredness score (=the number of working hours of a driver in the week prior to a transportation order start date) and the distance to the departure point (in km) of a scheduled transport. The outcome variable is also a binary variable illustrating whether a driver was assigned to that transportation order or not. For the current phase of the study, we define the following constraints: a driver should not have more than 40 h of work in a week and should not be on medical or annual leave. Furthermore, we currently assume that driver preferences are not taken into account and there is no enroute change of drivers. In future studies, we will integrate driver preferences and the possibility of enroute change of drivers as parameters for the training of our models. The records belonging to drivers that are on medical or annual leave at the moment of a scheduled transportation order are excluded from the dataset. The documented continuous variables were normalized in the range [0, 1]. The initial dataset consisting of 64,768 records was randomly divided into a training set of 51,814 records (80%) and a test set of 12,954 records (20%). Random forest (RF) and multi-layer perceptron (MLP) classifiers were developed. In RStudio, we utilized the caret:train function to construct the models, taking precautions to prevent overfitting by implementing 10-fold cross-validation. Implementation and mathematical details behind caret models in R are publicly available and can be consulted in the online documentation [20]. To handle imbalanced output classes, we applied the synthetic minority over-sampling technique (SMOTE) alongside the caret:train function. In order to ensure the study's replicability, Table 1 provides an overview of the parameters passed to the caret:train function. The sigmoid function was used as the transfer function for the MLP model. The caret:train function automatically tuned three hyperparameters for the mlpML method and one hyperparameter for the RF method. The automatically tuned parameters were the number of neurons in each of the three hidden layers corresponding to the mlpML method design and mtry corresponding to the RF method. The hyperparameters were tuned so as to maximize the model's accuracy. A detailed implementation flow chart of the RF and MLP classifiers is illustrated in Figure 1.  
The RF and MLP binary models were developed to predict whether an available locomotive driver should be assigned for a scheduled transportation order considering the current distance to the departure location and the tiredness score. The performance metrics of the RF and MLP models are compared and the algorithm with the highest accuracy is chosen to be integrated into the platform. \begin{table}
\begin{tabular}{l l} \hline \hline
**Method** & **“rf”/“mlpML”** \\ \hline preProcess & c(”scale”, “center”) \\ \hline trControl & trainControl(method = “repeatedcv”, number = 10, repeats = 10, \\  & sampling = “smote”) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Parameters used to train the ML models with the caret:train function. Depending on the availability, tiredness score at the moment of the freight transportation order, and distance to the departure point, the driver recommended to the dispatcher for assignment to each transport order is chosen based on the highest probability determined by the chosen ML model. If a driver already has 40 h of work in the week prior to a scheduled freight expedition or it are on medical or annual leave, they are automatically declared unavailable before querying the ML model. Figure 1: Implementation flow chart of the random forest and multi-layered perceptron models. The preprocessing and models' implementation are performed in RStudio version 2023.03.0+386 (3c53477a, 2023-03-09) for Windows.