## 4 Outer Dispatcher Methodology and Modelling
### Step 3--Optimal Modal Trip Composition (OMTC) Module  
The OMTC module assigns client requests to RP vehicles included in the current batch by means of an optimisation model that determines the modal composition of the trip requests under the current availability and capacity of RP vehicles as well as the suitable PT-AN locations selected by the previous filtering step described in Section 4.1. Observing Table 2, this module takes into account the type of requests that need to be served at each cycle of the Outer Dispatcher, taking into account their priority level, the user preferences expressed for the request and also whether the requests are new or come from a previous cycle, where they could not be resolved. The complete formulation of the optimisation model is described below. For the current cycle, it is assumed that there is a set \(N\) of requests in the current batch and a set \(J\) of vehicles that may satisfy them. The set of requests \(N\) will be divided into the subsets that have already been specified previously in Table 2. Set \(S\) contains the PT-AN points where clients may be dropped off to continue the trip using public transport. For convenience, vehicle 0 represents the \"null-taxi\" (not using an RP vehicle) and stop 0 represents the \"null-stop\" (not using the PT system). This means that a trip with \((j,k)=(0,0)\) represents the clients not served. Hence, two additional sets are defined for convenience: \(J_{0}=J\cup\{0\}\) and \(S_{0}=S\cup\{0\}\). The model that will be described uses binary variables \(x_{ij}\) and \(y_{jk}\), \(i\in N,\ j\in J_{0}\), \(k\in S_{0}\), that represent the assignments client-to-vehicle and vehicle-to-stop, respectively. Additionally, variable \(z_{ijk}\), defined as the product \(z_{ijk}=x_{ij}\cdot y_{jk}\), represents the assignment of a request to a vehicle visiting a PT-AN. Then, the optimisation model (c1) to (c6) below yields the modal trip composition, as listed in Table 3, depending on the resulting values for variables \(z_{ijk}\) for a vehicle \(j\) and stop \(k\) assigned at each request \(i\):  
The model considers the client's latest arrival time \(\hat{t}_{i}\), which corresponds to the request \(i\in N\), at the destination. It also presupposes that vehicles are already servicing other passengers, in which case the set of passengers aboard vehicle \(j\in J\) will be represented by \(P(j)\). Each passenger \(p\in P(j)\) has a latest arrival time \(\vartheta_{p}\) and an expected arrival time \begin{table}
\begin{tabular}{c c l} \hline \hline
**Vehicle** & **Stop** & **Modal Trip Composition for Request \(i\) When \(z_{ijk}=1\)** \\ \hline \multirow{2}{*}{\(j\)} & \multirow{2}{*}{\(k\)} & RP + PT trip \\  & & RP + PT + RP trip (dispatched RP + PT with estimated \(LL\)) \\  & & RP trip \\  & & \(LL\) leg of an RP + PT + RP or PT + RP trip \\
0 & \(k\) & PT trip \\  & & PT + RP trip (dispatched PT with estimated \(LL\)) \\
0 & 0 & retry again or reject \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Modal trip composition as provided by the OMTC module. at his/her drop-off point. Additionally, PT Journey Planner and MaaS Dispatcher assess the following parameters, representing the timings of potential assignments:  
1. \(\bar{u}_{ki}\) is the trip time of request \(i\) using PT, i.e., boarding at PT-AN \(k\) and travelling to the corresponding alighting PT-AN of request \(i\). 2. \(\bar{\mu}_{ijk}\) denotes the travel time for vehicle \(j\) to pick up the client \(i\) and leave it at the PT-AN \(k\in S\). If \(k=0\), then \(\bar{\mu}_{ijk}\) is the estimated time used by vehicle \(j\in J\) to the final destination of client \(i\). 3. \(\bar{\theta}_{ipk}\) is the additional detour time that passenger \(p\in P(j)\) will experience if the RP vehicle \(j\) he is boarded on picks up request \(i\). This notation is summarised in Table 4.