{'fraction_non_alphanumeric': 0.039670522681848466, 'fraction_numerical': 0.011507479861910242, 'mean_word_length': 4.260273972602739, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Study on the Calculation Models of Bus Delay at Bays Using Queueing Theory and Markov Chain

Traffic congestion at bus bays has decreased the service efficiency of public transit seriously in China, so it is crucial to systematically study its theory and methods. However, the existing studies lack theoretical model on computing efficiency. Therefore, the calculation models of bus delay at bays are studied. Firstly, the process that buses are delayed at bays is analyzed, and it was found that the delay can be divided into entering delay and exiting delay. Secondly, the queueing models of bus bays are formed, and the equilibrium distribution functions are proposed by applying the embedded Markov chain to the traditional model of queuing theory in the steady state; then the calculation models of entering delay are derived at bays. Thirdly, the exiting delay is studied by using the queueing theory and the gap acceptance theory. Finally, the proposed models are validated using field-measured data, and then the influencing factors are discussed. With these models the delay is easily assessed knowing the characteristics of the dwell time distribution and traffic volume at the curb lane in different locations and different periods. It can provide basis for the efficiency evaluation of bus bays.


Introduction
In recent years, with the rapid development of public transport, bus bays face an increasing pressure especially during peak hours. While serving passengers at a bus stop, buses can interact in ways that limit their discharge flows. This can increase bus delay at bays and degrade the bus system's overall service quality [1][2][3]. So it is necessary to evaluate the operating efficiency of bus bays and analyze the reasons for the increase of bus delay and then put forward the countermeasures to reduce the delay.
Though professional handbooks [4,5] have long offered formulas and tables for estimating bus-stop discharge flow, these are known to be unreliable [3,6]. The existing studies are mainly empirical formula based on the statistical analysis of actual survey data [7][8][9][10] and lack of theoretical model on computing efficiency. Therefore this paper studied the calculation models of bus delay at bays based on the analysis of the bus operating characteristics.

Analysis of Bus Delay at Bays
The form of bus bay is shown in Figure 1.
The berths are numbered 1 and 2 from the front to the back, and three buses arriving at the bus bay are numbered 1, 2, and 3 according to the arrival sequence. When buses 1 and 2 occupied berths 1 and 2 to serve their passengers, bus 3 must queue for entering upstream of the stop, as shown in Figure 1. The waiting time during this process is called entering delay.
In addition, when the serving is over at bus bays, the driver must look for a safe opportunity or "gap" in the traffic flow of curb lane to join them, as shown in Figure 2. The waiting time during this process is called exiting delay.
Therefore, the bus delays at bays mainly including entering delay and exiting delay are computed by the following equation: where is the entering delay, s; is the exiting delay, s.   We next derived the calculation models of bus entering delay and then studied the computing models of bus exiting delay. The calculation models of bus delay at single-berth and two-berth bays are proposed, respectively, finally.

Queueing Model of Bus Bays.
At the bus bays serving some lines, buses enter the berth sequentially, then load and unload passengers, and finally exit the stop. So the buses and the stop constitute a queuing system [11]. According to the present study, buses arrived at the stop as a Poisson process, as may occur when a moderately busy stop serves multiple bus routes [12,13]. So a stop with a general service time distribution and berths can be denoted as the / / queueing system. In this system, we define a regenerative point as the instant in time when the buses in all berths have discharged from the stop [14]. (Though the stop is empty at each regenerative point, it may be filled immediately thereafter if a bus queue is present at the entrance.) The time interval between two successive regenerative points is defined as a cycle. Let be the number of buses queued at the stop's entrance at the beginning of the th cycle (i.e., the th regenerative point); is the rate of Poisson bus arrivals; and recall that is the stop's number of serial berths. So we claim that the stochastic process { } is a Markov chain in given , , and the distribution of bus service times at the stop. A Markov chain is a sequence of random variables 1 , 2 , 3 , . . . with the Markov property, namely, that, given the present state, the future and past states are independent. In this system, the average bus delay in queue can be calculated once the Markov chain limiting probabilities are identified.
Based on observations of bus operations in China, three assumptions are adopted in the course of formula derivation as follows.
(1) It is assumed that bus overtaking maneuvers are prohibited, both within an entry queue and within the stop itself. Overtaking restrictions of this kind are common in cities, because an overtaking bus can disrupt car traffic in adjacent travel lanes.
(2) The bus operating at bays is isolated from the effects of traffic signals.
(3) The bus stop system operates in a stable state; the load rate = / < 1.

Single-Berth Stop.
In this section, we firstly analyze and compute the transition probabilities of bus stop system; the balance equations are then formulated and solved for the Markov chain limiting probabilities; and, lastly, the models which are used to calculate the average bus entering delay are proposed.

Transition Probabilities.
Firstly, we define the Markov chain transition probabilities: Let be the number of buses that arrived in the th cycle, so there is an equation at single-berth bus stop: ] . (5)

Balance Equation of
Limiting Probabilities. According to (5), the state transition diagram of single-berth bays can be drawn, as shown in Figure 3. Let be the serving time of the th bus; then { , ≥ 0} is a sequence of independent and identically distributed random variables, so we obtain the following equations: Computational Intelligence and Neuroscience In (6), { = | = } represents the probability that the number of bus arrivals during is . Buses arrived at the stop as a Poisson process, so the equation is Equation (7) was substituted in (6); we have So the expectation of is computed as follows: The variance of is computed as follows: Let ( ≥ 0) be the limiting probability that the Markov chain is in state ; that is, represents the limiting distribution of the Markov chain. Thus, is the solution to the balance equation: The equations are established according to the characteristics of the generating function, and then the balance equation of single-berth stop is resolved, as follows:

Average Bus Entering Delay.
At the single-berth bus stop, is the number of bus arrivals at the stop during the waiting time −1 and service time −1 of the ( − 1)th bus. Let ( ) and ( ) be the cumulative distribution functions (CDF) of and whichare mutually independent. So the average number of buses in the system can be calculated by the following formula: and = [ ] = (1); (13) was substituted in it; we have Combine (13) and (14) to solve the average bus entering delay at single-berth bays: 3.3. Two-Berth Bus Stop. The bus entering delay of two-berth bus bays is studied using the same approach as in Section 3.2.

Transition Probabilities.
Let be the number of buses that get served in the th cycle. Thus, Pr{̃+ 1 = , = | = } for 1 ≤ ≤ 2 represent the probability that the numbers of buses queueing at the stop's entrance at the beginning of the th and ( +1)th cycles are and , respectively, and the number of buses served at the th cycle is .

Computational Intelligence and Neuroscience
For an / /2 queueing system, there are six kinds of state transition occurring [14]. We obtain the transition probabilities by finding all the Pr{̃+ 1 = , = |̃= }: Then we determine the expression of each probability in (16) as follows.
(1) Pr{̃+ 1 = 0, = 1 |̃= 1}: this probability is equivalent to the probability that there is no bus arriving when the first bus finishes its service; thus where 1 is the headway following the first bus arrival in the cycle, s; 1 is the first bus's service time in the cycle, s.
(2) Pr{̃+ 1 = , = 2 |̃= 1}: through the analysis, there would be at least 2 arrivals in the cycle; that is, 1 < 1 . Let be the time between the 2nd arrival and its departure. Because the service time of buses is different, there are two possible scenarios at two-berth bus bays: the first bus finishes its service before the 2nd bus; the 2nd bus finishes its service before the first bus; thus where 2 is the second bus's service time in the cycle, s. We can derive the CDF of as Thus, for ≥ 0, the probability is computed as follows: Pr (3) Pr{̃+ 1 = , = 2 |̃= }: according to [6], the CDF of the platoon service time of two buses entering the stop simultaneously is 2 ( ); then for ≥ 2 and ≥ − 2 In summary, the mathematical expectation of transition probabilities of two-berth bus bays is given by for > 0, Computational Intelligence and Neuroscience 5 From the transition probabilities above, the balance equation of limiting probabilities can be written as 0 0,1 + 1 1,0 = 0, Then, we have The -transform method is used for this. We can write the balance equation in the -domain as Let = − + 2; (28) can be converted to Hence,

Average Bus Entering Delay.
Determining the average bus delay in queue requires the calculation of the average number of buses in queue over time. The average number of buses in queue is equal to the average of the queue length seen by each Poisson bus arrival. So it can be calculated by the next equation: where is the average number of buses in queue, buses; is the average of the queue length seen by the th bus arrival during , m; is the number of bus arrivals during , buses; is the number of cycles during ; is the number of bus arrivals during cycle , buses; is the sum of the queue lengths seen by each bus arrival during cycle , m; is the average of the sum of the queue lengths seen by each bus arrival during cycle , m; is the average of the number of bus arrivals during each cycle, buses.
To obtain and , we consider the following four scenarios which describe the possible states of the system at the start and end of each th cycle.
(1) No bus queues are present at the stop's entry, both at the start and at the end of the th cycle; that is,̃= +1 = 0. In this scenario, no bus arriving during cycle encounters a queue, and the number of buses that arrive during cycle is the number served during that cycle. So and can be denoted as = 0, = . (32) (2) A bus queue is present at the start of cycle , but not at the end of that cycle; that is,̃= > 0, and̃+ 1 = 0, and < 2. Then and can be denoted as (3) A bus queue is present both at the start and at the end of cycle , and the number of buses in queue is less than or equal to the number of berths; that is,̃= ≤ 2, and̃+ 1 = > 0. In this scenario, the stop is filled during the cycle; that is, = 2, and = + − 2. The first (2 − ) arrivals fill unused berths, such that the first (2 − + 1) arrivals see no entry queue. The following arrivals will see successively longer queues that range from 1 to ( − 1). Thus, (4) A queue size greater than 2 is present at the start of cycle, and a queue thus persists at the end of that cycle; that is,̃= > 2, and̃+ 1 = > − 2 > 0. In this scenario, as in the previous one, = 2, and = + − 2. And since the earliest bus of cycle is characterized by ( − 2) buses that remain in the entry queue, arrivals thereafter will see queue lengths in the sequence ( − 2 + 1), . . . , ( − 1). Thus where Pr{̃= ,̃+ 1 = , = } are the long-run probability of a cycle wherẽ= ,̃+ 1 = , and = are calculated by the next equation: So, Let = − + 2; (38) is converted to Therefore, we have From Little's formula [15], the average bus delay in the queue is then obtained: The operability of (41) is not strong in practice because it is too complicated. And therefore, it needs to be simplified. The approximate calculation model of bus entering delay of two-berth bays is obtained using the approximation theory of stochastic service system, as follows: where is the coefficient of variation in bus service time, which is computed by the next equation:

Calculation Models of Bus Exiting Delay
According to the queueing theory and the gap acceptance theory, the average exiting delay is equal to the average number multiplied by the average length of nongaps that bus waits for, as shown in (51). Oliver defined any time interval that is greater than the critical headway as a gap and remaining intervals as nongaps [16]: where 2 is the average number of nongaps that bus waits for; 1 is the average length of nongaps.
(1) Average Number of Nongaps That Bus Waits for. When headways are assumed to have a negative exponential distribution, the probability that bus will join without delay is where is the flow at curb lane, pcu/h; is the critical gap, s.
Computational Intelligence and Neuroscience 7 The probability that bus will be delayed is The number of blocks is The average number of vehicles between the starts of gaps is Therefore, the average number of nongaps that bus waits for is (2) Average Length of Nongaps. The total time spent in the nongaps is The total number of nongaps is The average length of nongaps is From this, it is noted that the average exiting delay is found by multiplying the average number by the average length of nongaps that bus waits for; that is,

Single-Berth
Bay. Based on the above analysis, the average bus delay at single-berth bays is calculated by (54): The average bus delay is calculated with (54) under different demands at single-berth bays, as shown in Figure 4. It can be seen that the bus delay grows slowly when bus flow is less than 60 buses/h and has a rapid growth once bus flow exceeds 60 buses/h.

Two-Berth
The average bus delays are calculated with (55) under different demand at two-berth bays, as shown in Figure 5. It can be seen that the bus delay grows slowly when bus flow is less than 100 buses/h and has a rapid growth once bus flow exceeds 100 buses/h.

Model Validation
The proposed model is validated using measured data at two bus bays of Tianmushan Road in Hangzhou city. The arriving time, queueing length, and service time of buses at Jingzhou North Intersection and Gudun Intersection bays during peak hours are surveyed by video. Then the delay of every bus is obtained by processing these data, as shown in Table 1. It can be seen that the average relative error between the calculated and the measured values of the bus delay is 10.44%. It shows that the proposed model can effectively reflect the operating characteristics of bus bays.

Influencing Factors Analysis
The calculated results above show that the bus delay depends mainly on the average service time at given bus bays. The longer the average service time, the smaller the capacity of stop, which means the bus delay will increase. In addition, it is also affected by the coefficient of variation in bus service time at multiberth bus bays, and the impact characteristics are shown in Figure 6. Visual inspection of this figure reveals that the value of bus delay grows larger with growing in the same bus flow. This is mainly due to the increasing impact between the servicing buses. Therefore, too many bus lines should not be set on the same stretch of road. Because more bus lines will surely increase the coefficient of variation in bus service time, the interaction between buses will be intensified.
According to previous experience, 4 or 5 bus lines at most are set up on the major roads in the city [4,5].

Conclusion
Formulas were developed to predict the average bus delay at bays. The formulas use a Markov chain that is embedded in the bus queueing process, the queueing theory, and the gap acceptance theory at these bays. Exact solutions were derived for two special cases: single-berth and two-berth bays. And approximations matched up to the surveyed results. With this methodology, the bus delays at bays are obtained easily if the characteristics of the service time distribution and traffic flow are known. And the results of this paper can provide basis for the efficiency evaluation of bus bays.