{'fraction_non_alphanumeric': 0.03268453911127433, 'fraction_numerical': 0.01071678963709812, 'mean_word_length': 4.453122155470599, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Crossover transitions in a bus-car mixed-traffic cellular automata model

We modify the Nagel-Schreckenberg (NaSch) cellular automata model to study mixed-traffic dynamics. We focus on the interplay between passenger availability and bus-stopping constraints. Buses stop next to occupied cells of a discretized sidewalk model. By parametrizing the spacing distance between designated stops, our simulation covers the range of load-anywhere behavior to that of well-spaced stops. The interplay of passenger arrival rates and bus densities drives crossover transitions from platooning to non-platooned (free-flow and congested) states. We show that platoons can be dissolved by either decreasing the passenger arrival rate or increasing the bus density. The critical passenger arrival rate at which platoons are dissolved is an exponential function of vehicle density. We also find that at low densities, spacing stops close together induces platooned states, which reduces system speeds and increases waiting times of passengers.


Introduction
Public transportation is universally acknowledged as a fundamental component in solving traffic congestion. Together with rail systems, buses form the backbone of medium-to long-haul modes of people transport. Since the interaction of buses and passengers introduces complex behavior in transportation systems, more so in cities that do not have designated stops, several models have been proposed to study bus traffic [1][2][3][4][5]. In these models, a delay in the arrival time of a bus leads to more passengers waiting for the bus, which then leads to further delays. Succeeding buses find fewer waiting passengers leading them to catch up to the delayed bus. Thus, buses form platoons (or bunches). These models also show a transition from the platooning state to a non-platooned state with increasing bus density.
The tendency of buses to form platoons is problematic for public transport. In an ideal scenario, an efficient transport system would try to maintain equal time intervals between vehicle arrivals. However, an equal headway configuration of vehicles is unstable [6], more so with buses [1]. Since the instability is inherent to the interaction between public transport vehicles and passengers, approaches to maintain equal headways should consider both traffic and passenger behavior [7].
Bus route models [1][2][3] omit interactions between buses and other vehicle types. Yet we expect that these vehicular interactions play a key role in the dynamics of traffic flow -buses making curbside stops impede traffic flow outright [8], while small perturbations in vehicle speeds can induce congestion [9,10]. Even a single bus in two-lane mixed traffic alters traffic states and jam transition densities [11]. As such, it is also critical to decision makers when curbside stops have to be replaced by bus bays to alleviate congestion [12]. Using a modified comfortable driving model, Yuan et al. [13] focused on system performance to show a dependence of the system capacity on the number of bus stops. They also found a gradual transition from platooned to non-platooned states. However, they did not explore the interplay of passenger arrival rates and vehicle densities extensively nor considered passenger waiting times.
It is important to understand transitions in traffic models with public transportation in mind. Slower moving buses and the associated platoon formation can result in the perception that buses cause congestion. Even a few undisciplined bus drivers can often cause traffic jams when their large vehicles straddle multiple lanes [14,15]. Such situations, as well as a lack of understanding of these systems, can lead to proposals by policymakers to ban buses to alleviate congestion. An example of which would be the proposal to ban provincial buses (which account for less than 3% of traffic volume [16]) from Metro Manila's highways to alleviate congestion in one of the city's major thoroughfares [17,18]. A Melbourne study found that the removal of such bus services would see up to 30% of bus users shifting to cars, which defeats the purpose of eliminating buses to alleviate congestion [8]. Knowledge of the factors that influence transitions can inform decisions, avoiding policies that can cause more harm to the current state of traffic congestion.
This work studies the transitions induced by vehicle density and passenger arrival rate on a Nagel-Schreckenberg model modified to include buses. We show how the interplay between vehicle density and passenger arrival rates affect the crossover transition from non-platooned to platooning states. Both singleand multi-lane cases, as well as mixed traffic scenarios, are studied. Lastly, we look at the effects of the placement of bus stops on traffic flow, as well as passenger waiting times.

Modified Nagel-Schreckenberg model
Our model combines elements from the Nagel-Schreckenberg (NaSch) [14,19] model and Bus Route Model (BRM) [1]. The two components of this hybrid model are the road and sidewalk (Fig. 1). The road model R has N lanes of length L sites, with periodic boundary conditions. A vehicle can interact with passengers (buses), or ignore passengers (cars). A sidewalk model S with one lane of length L sites is updated synchronously with the road model. States for the ith vehicle are lane l i , position x i , and speed 0 ≤ v i ≤ v max . We denote sites occupied by cars as R(x, l) = 1 and those occupied by buses as R(x, l) = 2. The road lane adjacent to the sidewalk is denoted as l = 1. Passengers occupy the sidewalk if S(x) = 1. Similar to the BRM, we impose that R(x, l = 1) = 2 and S(x) = 1 cannot occur simultaneously, i.e. passengers cannot spawn when a bus occupies the adjacent road cell.
For simplicity, both vehicle types have similar parameters v max and p slow , with the only difference between the two being the additional interaction with pedestrians 1 for buses. Additionally, buses have infinite passenger capacity, though we include a short discussion on the effect of finite passenger capacities in Sec. 3.1. Realizations of the model involve assigning vehicle density ρ, passenger arrival rate α, and bus to vehicle ratio f B . Vehicle states are updated in random sequential order at each timestep t (δt = 1.65 sec/step) following these rules: The headway ∆x i is the number of empty cells ahead of vehicle i while the passenger headway ∆x pass is the distance from the bus to the closest passenger. The implementation of Deceleration for buses ensures deceleration rates are limited to a dec when picking up passengers [23,24]. The first criterion lets a bus ignore passengers that appear when the bus is passing too fast to safely decelerate. The second criterion allows a bus to anticipate stopping, and decelerate safely. For cars, Bus Loading is skipped. Vehicles may change lanes with probability p l ∈ {0, 1} with equal chances of moving left or right. Vehicle i attempts to move into adjacent lanes to avoid decelerating, but it may only change lanes if the target lane is empty and it satisfies the safety criteria. It is safe to change lanes when the trailing vehicle in the target lane can safely decelerate without crashing into vehicle i. The safety criteria can be written as where j denotes the trailing vehicle. In the context of overtaking vehicles, Random Slowdown is skipped when a vehicle successfully changes lanes. Otherwise, the original NaSch rules (R1, R4, R5, R6) are followed. Through these rules, interactions of vehicles and pedestrians give rise to complex dynamics of traffic flow.
We measure the time averaged flow q of the system, defined as q = 1 T T t=1 where v i t is the speed of the i th vehicle at time t. The average speed of vehicles in the system is thenv = q ρ .
We allow for a transient simulation time of T τ = 3000 timesteps to remove transient behavior in the data [21]. For all realizations, measurements span T = 3000 timesteps with fifty trials for each set of parameters  ρ, α, and f B . A complete list of parameters used in our simulations, with their corresponding calibration factor and real-world values, is given in Table 1.

Results and Discussion
In Sec. 3.1, we focus on the interplay of changing passenger arrival rates, fraction of buses, and transitions for the single lane case. Section 3.2 extends the model to multiple lanes, with buses being limited to the outermost lane. Section 3.3 discusses placement of bus stops, and the effect of different bus fractions on the waiting time of passengers.

Single lane case
If all vehicles on the road are buses (f B = 1), we expect different behaviors at the extreme values of α. For the case α → 0, passengers do not arrive. With no passengers to pick up, buses do not slow down, and we recover the original NaSch model. In the NaSch model, we expect a phase transition to occur at ρ crit = 1 vmax+1 , which is the maximum allowable density where vehicles have enough headway to avoid slowing down [19,25]. For the case of v max = 5, ρ crit ≈ 1 6 . Thus, increasing the density beyond ρ crit induces a phase transition from free-flowing traffic to congestion. On the other extreme, as α → 1, buses stop after every other timestep. High values of alpha guarantee that there will be a passenger waiting for a bus at the next cell. Thus, at low densities, we expect buses in this system to move at an average speed ofv = 0.5 sites per timestep. A transition occurs at ρ ≈ 2 3 , which corresponds to the critical density for v max = 0.5. We verify the existence of these two limiting cases (Fig. 2). Two competing trends appear to govern the dynamics of the system: (1) bus interactions with passengers which tend to drive the average speed of the system tov → 0.5; and (2) the dynamics of the NaSch model without buses (α → 0 or equivalently, f B = 0). For the values of f B = 1.0, α = [10 −3 , 10 −2 , 10 −1 ], we observe that for low densities, buses picking up passengers is the dominant behavior. However, increasing the density of buses results in jumps in throughput in the fundamental diagram. These jumps indicate that the dominant behavior of the system has shifted towards the dynamics of the fundamental NaSch model (Fig. 2, f B = 0). We also observe that the density values at which these jumps occur shift to higher densities, as the passenger arrival rates are increased.
This interplay between α and ρ suggests that low values of density allow for passengers to accumulate on different sites of the sidewalk, which forces buses to make more frequent stops. On the other hand, increasing the density of buses not only accounts for the pick-ups of these passengers, but also prevents the accumulation of passengers in the system. An interesting consequence is that the average speed of the system actually increases.
We can look at the interplay between ρ and α in another way, by varying α for fixed values of ρ. We observe that the crossover from non-platooned to platooned states depends on α (Fig. 3a). For a fixed density, once α becomes sufficiently large, passengers accumulate in the system, which results in more frequent stops for buses. This sets the formation of a platoon of vehicles, while at the same time allowing for more passengers to accumulate ahead of the platoon. Figure 4 illustrates the crossover from either a free flow or congested phase to a platooned phase for two different values of α. A platoon develops from an initial non-platooned configuration as arrival rates are increased above some critical value α * . For a system with a density of ρ = 0.4, we find that α * ≈ 10 −1.91 (Fig 3a). In the case of α = 10 −2 , platoons do not form in the system at all. However, when we look at the case of α = 10 −1.8 , a platoon develops after 600 timesteps, despite having the same initial configuration for the case α = 10 −2 . As passengers accumulate in the gaps between buses, the decrease in the speed of buses creates larger gaps. This feedback loop drives the formation of platoons and also results in longer passenger waiting times.
For the case of mixed traffic (Fig. 2, α = 10 −3 ), the transition from a platooned to a non-platooned phase occurs at lower densities with increasing f B . This observation is still consistent with the notion of the transition from platooned to a non-platooned phase due to increasing density of buses. As the effective bus density scales with f B , higher densities are needed to compensate for lower f B . Thus, reducing f B shifts the crossover transition to higher densities.
We can make two observations of our single lane model. First, we see that there exists a ρ * (α) responsible for a crossover behavior from a platooned phase to either a free-flow or congested phase. When ρ < ρ * , a low f B gives more time for passengers to accumulate in the gaps between buses. At the same time, buses will tend to clump together, creating larger gaps. Both processes aid in the formation of platoons. When ρ > ρ * , the gaps between buses are sufficiently small to substantially reduce passenger accumulation that cause a cascade of slowdowns. Thus, smaller or no platoons are formed, and we obtain a non-platooned phase.
Secondly, the crossover from a platooned to a non-platooned phase is also determined by α * (ρ). For arrival rates α < α * , the system would be found in the non-platooned phase, while for α > α * the system will exhibit platooning. The dependence on ρ is only up to ρ ≈ 2 3 , beyond which the density-dependent dynamics of the NaSch dominates the system. Figure 3b highlights the interplay between α * and ρ. The crossover transition value appears to scale as α * ∼ exp(ρ + c). We observe the scaling only until ρ = 0.56, beyond which the platooning and congestion effects are difficult to distinguish. Unlike the phase transition from free flow to congestion which only occurs at low densities, this crossover can occur at densities above ρ crit . While the phase transition from free flow to congestion is undoubtedly an important aspect in the study of transport and vehicular traffic, the densities involved are typically low densities. Since the problem of congestion in city traffic involves densities above ρ crit , this particular phase transition is rather insignificant when it comes to policy intervention since controlling vehicle volume is difficult. However, the crossover transition of passenger-bus interactions is present for a larger range of densities. The key to managing traffic flow at densities above ρ crit must then lie in avoiding the formation of platoons. The behavior of buses in our simplified model has underlying assumptions that are absent in real traffic. Buses in our model have infinite capacities, do not wait for passengers, and our model does not have passenger drop-offs. What happens when we relax these assumptions?
From infinite to finite bus capacities. With each bus having a passenger capacity c, the "leading bus" gets filled up and eventually stops picking up passengers. Said bus breaks away from the platoon that it leads, leaving the next bus as the new "leading bus". The notion of a "leading bus" in this case is not specific to a single bus, as any unfilled bus can be the "leading bus" and cause a platoon. A spatio-temporal diagram of our model with different capacities shows this phenomenon (Fig. 5).
If the passenger volume eventually exceeds aggregate bus capacity, all buses will be full after some time T cap . In the case of Fig. 5, T cap ≈ 3000. At that moment, the platoon dissolves, and we recover the dynamics of the NaSch model. While this speeds up the movement of vehicles and passengers on board the buses, this also means that those who have yet to board will have to wait indefinitely for a bus. We find that T cap scales linearly with the passenger capacity c, for all densities and passenger arrival rates (Fig. 6).
From no-waiting to waiting for passengers. Allowing buses in our model to stop for a duration T wait is analogous to waiting for passengers or making scheduled stops. In effect, this slows down the movement of the platoon (Fig. 7a). In the limit that α is sufficiently large, we can calculate the average speed of the platoon asv = 1 Twait+1 . In the case of our simplified model, T wait = 1 and we havev = 0.5. Aside from slowing down the platoon, increasing the stop duration of buses shifts the crossover transition to higher densities. We find that for the same densities, having shorter waiting times cause their transitions to occur at higher values of α (Fig. 7b). This ties into the mechanism of platoon formation, as when buses wait longer at stops, the average speed of the platoon decreases. For the same pedestrian spawning rate α, this decrease in platoon speeds results in more pedestrians accumulating ahead of the platoon. term picking up passengers is useful in creating a mental picture of what goes on in the model, a better interpretation is that these are stopping events as a result of passengers boarding and alighting the bus. Instead of explicitly modeling multiple passengers boarding (and alighting) buses at the sidewalk, buses can be filled (and emptied) by multiple passengers at a single stop. This works in the regime where the net flux of passengers do not fill up buses. When buses are close to capacity, explicitly modeling drop offs influences the dynamics of buses. In Fig.  5, we show that as buses reach their capacities, they break away from the platoon, and can end up at the tail of a different platoon. If no passengers alight, the bus catches up with the tail of the next platoon. On the other hand, if a passenger alights within the route, the bus once again becomes a potential platoon starter. In this way, a bus can alternate between a platoon starter, and a platoon trailer, depending on the distribution of drop-off points of passengers. If passenger drop-offs are spread uniformly throughout the route, we expect to see several smaller platoons instead of a single large platoon. Note that some commute routes would have a concentration of pickups at the start of the route, and drop-offs at the end of the route. This situation would resemble the dynamics of buses at capacity, with faster transit speeds as stops mid route are minimized.

Multi-lane traffic
We now extend the single-lane model to two lanes. In this model, we restrict buses to drive along the second lane, while cars can move freely on any lane. As buses stop to pick up passengers, they block the movement of vehicles on the bus lane. Lane changing allows cars to overtake stopped or slow-moving buses, though the maneuver can cause congestion on the adjacent lane. Buses cause bottlenecks, which greatly reduce the flow of vehicles in the system. These bottlenecks are similar to work zone scenarios [26], with the key difference being that the flow reduction is temporary and that the bottleneck is non-stationary.
In the case of multiple lanes, we see three regions in the fundamental diagram for the case of α ≥ 10 −1 (Fig. 8). The first two regions are from 0 < ρ < 0.12 and 0.12 < ρ < 0.66. In the single lane case, when α is sufficiently high, a bus moves slowly as it picks up passengers, which obstructs all other vehicles behind it. In the multiple lane case, cars can overtake the slow-moving buses and prevent the platoon formation (0 < ρ < 0.12).
For the second region (0.12 < ρ < 0.66), traffic flow in the two lanes gets coupled due to cars changing lanes. As platoons form behind slow-moving buses, they impede the movement of cars in the second lane. When these cars switch lanes, they also slow down vehicles in the first lane (see spatio-temporal diagram, Fig. 8). On the other hand, we also see that these cars can utilize gaps between platoons. Platoons in this multi-lane model do not appear as a single clump of closely spaced vehicles followed by a large gap of space. Instead, many smaller platoons form, with overtaking cars utilizing the gaps between platoons. However, this region does not exist for the case of α ≤ 10 −3 , as the arrival rates of passengers is not high enough to cause the platoon formation. Thus, in the absence of platoons, the speeds of buses and cars are similar, and we recover dynamics similar to the NaSch model. The remaining region (ρ > 0.66) marks the dissolution of the platoons in the bus lane. In this region, the density has increased enough such that both lanes move at similar speeds. As a result, the effect of bus pickups is indistinguishable from the congested dynamics of the NaSch model. We also observe this phase in the case of a crossover transition occurring when ρ < 0.66 (such is the case when α = [10 −2 , 10 −3 ]).
In this multi-lane scenario, stop durations increase when buses are allowed to wait for passengers. This slow-down has a two-fold effect: it reduces overall platoon movement; and it impedes the adjacent lane as more cars move out of the bus lane.

Periodic stops
In the previous sections, passengers may board and alight on any segment of the road. Such a scenario is common in cities like Manila and Jakarta, whereas having designated bus stops is a more common occurrence worldwide. As such, it is natural to take accessibility into account when designing stop locations. Closer spacing between stops can improve accessibility for commuters. But when spaced too closely, stops slow down transit travel speeds [27].
The decentralization of bus franchise operators in cities like Manila makes it challenging to plan for different aspects of a transit system. In routes that do not have sufficient demand, buses will be infrequent. Uncertainty in arrival times of buses in such cases can lead to either long waiting times, as well as a reduction of demand as commuters search for a more reliable alternative. Implementing bus timetables can help manage passenger expectations and establish the reliability of the transit system.
In comparing realizations with different distances between designated stops d, we assumed the same total number of passengers. Thus, we fixed the value of the pedestrian arrival rate for the entire system A = α L d per timestep. With fewer stops (larger d), the arrival of passengers at each stop, α, rises commensurately. We ran simulations for d ∈ [1,4,16,64,256], and fixed A = α max L dmax , such that when d = 256, α = 0.1. A maximum value of d = 256 is specifically chosen for our cell size of 5.5 m, as this corresponds to a 1.408 km distance between stops. We choose this based on the assumption that at most, a pedestrian would be forced to walk 704 m for a destination in between two stops. To account for our choice of d max , we use L = 5120 and set A = 2 for simulations in this section. For comparison, we will look at the cases ranging from all buses (f B = 1) to a low bus volume, Philippines-inspired case (f B = 0.03) [16].
First, we look at the single-lane case of an all-bus system. Increasing the distances between stops improves the overall speed of the system for ρ < 0.12 ( Fig. 9a and 9b). The inflection point at ρ ≈ 0.12 corresponds to the crossover transition from platooning to a non-platooned phase. Configurations with d ≤ 64 exhibit an inflection at ρ ≈ 0.12, a crossover transition which is absent in farther-spaced stops (d = 256). We observe similar behavior in the f B = 0.03 case (Fig. 9c), where system speeds increase with station separation distances, but with two key differences from the all-bus (f B = 1) case. Only d = 1 and d = 4 have crossover transitions that occur at higher densities, and the case of d = 256 does not have slower system speeds than d ≤ 64 for all densities.
We attribute the slowdown of vehicles in the case of d = 256, f B = 1 to the high arrival rates of passengers, which form slow-moving jams near the stops where buses have a high probability of stopping. Due to our model design, buses do not wait for passengers at stops. Since the distance (and time) headways between succeeding buses are short, the high arrival rates of passengers would make succeeding buses stop at the station. If a bus can wait for multiple passengers, buses behind it would not have to stop often, which would improve the overall system speeds.
In general, we expect the average number of buses that stop to board passengers should be the same for all realizations of d. Allocating larger separation distances between stops reduces the frequency of stops made by buses. This allows buses to maintain their top speeds for longer, and results in a higher system

throughput.
System speeds, however, only paint half of the picture. Travel begins when the pedestrian leaves his origin, not at the moment the pedestrian boards a vehicle. Thus, it is necessary to include the time spent waiting for public transport. We find that the spacing of stops matters most in medium to low density regimes (ρ < 0.2 for f ∈ [0.25, 0.5, 1], ρ < 0.32 for f B = 0.03, Fig. 10). Having stops close to each other increases waiting times of passengers, more so at low densities. Because of platooning, bus delays lead to more waiting passengers, which in turn causes further delays. Thus, waiting times can reach more than 30 minutes when buses are allowed to stop anywhere (d ∈ [1,4]). Increasing stops separation therefore results to faster system speeds and shorter waiting times.
For low densities, passenger waiting times increase with decreasing system density. Infrequent bus arrivals force passengers to wait longer. Spacing stops close together exacerbate platooning effects -even spacing of bus headways are not maintained, and stopping occurs more frequently. This also leads to inefficiencies, as buses may arrive just after the preceding bus finished boarding. In situations where public transport is deficient by way of long waiting times, having a bus timetable would help. A communicated schedule allows passengers to adjust their arrival at the station accordingly, effectively lowering expected waiting times.
For higher densities (ρ > 0.16), waiting times become constant for the all-bus case (Fig. 10, f B = 1). Furthermore, the wait is just one timestep: the pedestrian gets to ride the bus one timestep after getting to the sidewalk. While this looks good from the point of view of passengers, it is quite inefficient since some buses fail to pick up passengers. We set the net pedestrian arrival rate A = 2, but the number of buses in the system for ρ > 0.18 is more than 921. Even if our model does not take into account bus passenger capacities, we can already see that reducing the number of buses may improve system speeds without loss of service reliability.
In mixed traffic settings, waiting times do not remain constant with increasing vehicle density. At sufficiently high road densities, waiting times also increase. Increased waiting times at higher road densities are an indication of insufficient supply of buses. The lack of buses, coupled with the slow speeds of vehicles on the road, lead to prolonged waiting times as congestion gets worse (Fig. 10, f B = 0.03).
Allowing passengers to board and alight vehicles at any point is an attractive idea. The convenience of being able to go directly from your origin to your destination is the value proposition of owning personal vehicles or using taxis, ride-sharing services, and forms of para-transit such as tricycles, pedicabs, and habalhabal, which are prevalent in the Philippines. This mentality bleeds into other forms of public transportation such as buses, Jeepneys, and AUVs, which do not have designated stops. Our work supports the notion of planning out stops that are spaced further apart, but we must also take into account the added time and effort to the commute of a passenger whose stops would lie in between two stops.
The growing popularity of ride-sharing services also causes problems. Although these have infrequent stops, their point-to-point nature is similar to a system of buses that do not have well spaced stops. Entire fleets of these vehicles can end up clogging roads and side-streets while they wait for their next booking. If left unchecked, the sheer number of ride-sharing vehicles waiting for passengers can end up negating any benefits from a well designed public transport system.

Conclusion
Platooned flow is characterized by bunched slow-moving buses that leave gaps on the road. Platoons disappear either by having fewer riders or more buses, and results to an equal headway configuration. With multiple lanes, platooned dynamics spill over to the non-bus lane, and persists until the platoon is dissolved.
Platoon formation is driven by interactions at stops. Spacing out stops speeds up traffic by minimizing platooning and queuing-induced congestion. However, spacing them too far would make walking to a midpoint destination impractical. Load-anywhere behavior, while convenient for an individual, comes at the cost of slower traffic flow and longer waiting times. To mitigate the formation of platoons, sticking to a bus schedule helps. Cities may also incentivize staggered work schedules while ensuring adequate bus supply.
Though our model did not take into account multiple passenger arrivals on sidewalk cells, finite bus capacities, and alighting scenarios; we can estimate their effects. If we account for multiple passenger arrivals, the waiting times belong to the first passenger in the queue, and thus a lower limit. Adding finite capacities to buses dissolves platoons when buses are full, but the resulting increase in vehicle speeds comes with longer passenger waiting times. Allowing buses to wait for passengers at stops, rather than the other way around, slows down the overall movement of platoons resulting to congestion.
Microscopic models, like ours, would benefit from the increasing use of real-time sensors that drive smart city initiatives worldwide. With rapid parameter calibration, we can realize the idea of immediately actionable predictions.