## 2 The Bus Synchronization Problem
### Bus Occupation Model  
Concerning the proposed bus occupancy model, it combines random passenger boarding with deterministic alighting processes. The random boarding process is based on a Poisson distribution, which is a probabilistic distribution that is a commonly used model for random arrivals that are independent and identically distributed [27; 28]. Given the assumption of regularity throughout the planning period--during which relevant data for the problem can be considered steady--the Poisson process is considered to have a fixed rate. Consequently, given the average daily number of tickets sold for line \(i\) within the planning period \([0,T]\), represented by \(ts_{i}\), the rate at which passengers board any bus on that line is denoted as \(\Lambda_{i}=ts_{i}/T\). \(\Lambda_{i}\) signifies the rate of passengers that any running bus \(i\) is expected to pick up, including those who board at any bus stop along the entire set of stops covered by the bus line. The bus occupancy model requires a reference occupancy distribution for each individual bus. By assuming independent passenger arrivals and considering the large number of bus stops, the arrival process at each bus can also be characterized as a Poisson process, and its arrival rate needs to be adjusted to match the overall line's arrival rate. In contrast, the rate of passengers alighting is assumed to be deterministic and constant. Let \(L_{i}\) represent the travel distance for passengers on line \(i\), and \(V_{i}\) represent the average speed of buses on the same line. The time each passenger spends on a bus before disembarking can be calculated as \(td_{i}=L_{i}/V_{i}\). All buses on line \(i\) commence their trips empty, to pick up passengers along the route. Since the alighting time is fixed at \(td_{i}\), during the time interval \([0,td_{i}]\), buses solely receive new passengers (i.e., no passengers disembark during this interval). This interval is referred to as the _ramp-up_period_. The end-to-end travel time for buses on line \(i\), denoted as \(T2E_{i}\), is known because it is calculated from Global Positioning System (GPS) records for each bus. For consistency, the model also assumes a _ramp-down period_ at the end, specifically \([T2E_{i}-td_{i},T2E_{i}]\), during which no new passengers board the bus. Finally, the bus occupancy model assumes fixed headways, represented as \(F^{i}\), for each line \(i\). If passengers for a particular line are evenly distributed throughout the entire end-to-end travel time, the arrival rate for each bus would be \(\Lambda_{i}\cdot F^{i}/T2E_{i}\). However, to maintain the expected number of tickets sold, the rate must be adjusted to \(\overline{\Lambda_{i}}=\Lambda_{i}\cdot F^{i}/(T2E_{i}-td_{i})\), taking into account the ramp-down period. The previous model was implemented using the discrete event simulator as in Algorithm 1, where function _poisisrnd_\((\overline{\Lambda_{i}},T2E_{i}-td_{i})\) draws \(T2E_{i}-td_{i}\) samples of independent and identically distributed Poisson random variables of parameter \(\overline{\Lambda_{i}}\). The parameter _Samples_ indicates the number of simulations to be performed.