## 3 Simulation-Based System Architecture
### Requests Queue Scheduler
#### 3.4.4 Prioritised Classification of Requests and Their Dispatching Policies  
So far, the request types that have been considered are HN and B (because of promptness) as well as the users' modal preferences (a, b and =) described in Section 3.1. Considering also the presence of trips with delayed last legs of RP, four sets of requests gathered during a cycle will have to be considered for being resolved by the Outer Dispatcher accordingly to a system of priorities as well as a set of actions on them. The four sets are:  
* \(\mathbf{N_{HN}}\) = set of \"Here and Now\" requests, i.e., made in the same period. They have the lowest priority and are given two attempts for dispatching. * \(\mathbf{N_{B}}\) = set of Booking requests, i.e., made in advance to the simulation horizon. They have higher priority than HN requests and are given as many dispatch attempts as possible until their time window is overcome. * \(\mathbf{N_{LL}}\) = requests that come from trips that have already been dispatched in a previous period as two-leg trips (PT + RP) or as three-leg trips (RP + PT + RP) that in the first cycle estimated their last leg of RP. They are waiting for the system to finally dispatch the last leg. They have the maximum priority and are given as many attempts as possible until their request's time window can no longer be met. These requests are present in the events list and are included in the current cycle with some anticipation as stated below in Equation (1). * \(\mathbf{N_{W}}\) = set of waiting requests that have entered the system at least in the previous period (batch dispatching period) but have not yet obtained a dispatched trip. These requests were initially included into one of the \(N_{B}\), \(N_{HN}\) or \(N_{LL}\) request sets at an earlier cycle, but they have not been yet resolved. To finally outline the actions adopted by the dispatching policy, there follows a description of (a) the instants where a booking or a last-leg request should be either considered to be dispatched in the current cycle or finally rejected if no feasibility is detected, and (b) the time instant where the vehicle relocations for LL availability should be fired. Notice that these policies actually provide a sharper definition of the previous sets \(N_{HN}\), \(N_{W}\), \(N_{B}\) and \(N_{LL}\):  
* **LL requests*
* to dispatch in the current period. Let \(N_{LL}^{-}\) be the set of requests \(i\), previous to cycle \(c-1\), that result in an LL request and let \(\xi_{i}\) be the time, counted from cycle c, remaining for the customer of request \(i\) to leave the final PT-AN, thus completing the journey until its PT leg. Then, the subset of LL requests, \(N_{LL}\), that will finally be dispatched in the current cycle will be those with an anticipation \(\zeta_{i}\) of at most \(\theta\approx 15\) min, i.e. : \[N_{LL}\overset{\Delta}{=}\left\{i\in N_{LL}^{-}\mid\zeta_{i}\leq\theta\right\}\] (1)
* **Booking requests to dispatch in the current period. *
* Let \(\xi_{i}\) be the time remaining, counted from cycle \(c\), for picking up the customer and let \(B\) be the set of Booking requests (negative values for \(\xi_{i}\) imply that a delay is incurred). Therefore, bookings are taken into account by the scheduler when the time remaining \(\xi_{i}\) is smaller than a given threshold \(\theta^{\prime}\), which has been estimated to be 30 min. This makes that the set of Booking requests \(N_{B}\) considered for dispatch in the current cycle will be: \[N_{B}\overset{\Delta}{=}\left\{i\in B\mid\xi_{i}\leq\theta^{\prime}min\right\}\] (2)
* **LL requests requiring a vehicle relocation in the current period. *
* An LL request can still wait to trigger a vehicle relocation when it still has some margin until it leaves the PT and has several vehicles that could serve its LL with a small waiting time for the vehicle. Let \(\tau_{ji}\) be the estimated travel time necessary for the RP vehicle \(j\) to reach PT-AN of client \(i\) (the originator of the LL request).