Improving public transportation systems with self-organization: A headway-based model and regulation of passenger alighting and boarding

The equal headway instability—the fact that a configuration with regular time intervals between vehicles tends to be volatile—is a common regulation problem in public transportation systems. An unsatisfactory regulation results in low efficiency and possible collapses of the service. Computational simulations have shown that self-organizing methods can regulate the headway adaptively beyond the theoretical optimum. In this work, we develop a computer simulation for metro systems fed with real data from the Mexico City Metro to test the current regulatory method with a novel self-organizing approach. The current model considers overall system’s data such as minimum and maximum waiting times at stations, while the self-organizing method regulates the headway in a decentralized manner using local information such as the passenger’s inflow and the positions of neighboring trains. The simulation shows that the self-organizing method improves the performance over the current one as it adapts to environmental changes at the timescale they occur. The correlation between the simulation of the current model and empirical observations carried out in the Mexico City Metro provides a base to calculate the expected performance of the self-organizing method in case it is implemented in the real system. We also performed a pilot study at the Balderas station to regulate the alighting and boarding of passengers through guide signs on platforms. The analysis of empirical data shows a delay reduction of the waiting time of trains at stations. Finally, we provide recommendations to improve public transportation systems.

The equal headway instability-the fact that a configuration with regular time intervals between vehicles tends to be volatile-is a common regulation problem in public transportation systems. An unsatisfactory regulation results in low efficiency and possible collapses of the service. Computational simulations have shown that self-organizing methods can regulate the headway adaptively beyond the theoretical optimum. In this work, we develop a computer simulation for metro systems fed with real data from the Mexico City Metro to test the current regulatory method with a novel self-organizing approach. The current model considers overall system's data such as minimum and maximum waiting times at stations, while the self-organizing method regulates the headway in a decentralized manner using local information such as the passenger's inflow and the positions of neighboring trains. The simulation shows that the self-organizing method improves the performance over the current one as it adapts to environmental changes at the timescale they occur. The correlation between the simulation of the current model and empirical observations carried out in the Mexico City Metro provides a base to calculate the expected performance of the self-organizing method in case it is implemented in the real system. We also performed a pilot study at the Balderas station to regulate the alighting and boarding of passengers through guide signs on platforms. The analysis of empirical data shows a delay reduction of the waiting time of trains at stations. Finally, we provide recommendations to improve public transportation systems. PLOS

Introduction
There are 204 Metro systems in the world used by 112 million passengers every day [1]. In particular, the Mexico City Metro (MXM) serves approximately 5.5 million users each day and is integrated by 12 lines [2]. Public transportation systems (PTS) are conformed by an heterogeneous group of elements such as passengers, trains, tracks, stations and traffic lights. A computer model is useful to consider relations between their elements and for expressing the most representative variables and studying the effect of interactions [3][4][5]. Computer simulations based on real databases can replicate the dynamics of the system in different conditions and at the same time provide the capacity to test appropriate regulatory methods at different scales [6]. PTS work with a set of rules and procedures described in operation manuals. In many cases, systems are automatized or semi-automatized; sometimes, the operation is regulated manually. Moreira-Matias [7] provides a survey to improve the operational control and planning using automatic vehicle location and gives formal definitions in this area. For instance, in the MXM, a centralized system is used to monitor the locations of the trains using rail sensors, GPS is not available.
The application of a set of operating rules, the decision-making based on the system's performance, and the behavior of users create the global dynamics of the system, which can be monitored by taking into account the most significant processes such as the time interval between trains, also known as the headway, alighting and boarding time of passengers and the waiting time of trains at stations. The MXM is considered a high frequency transit line due the small values of the headways: about two or three minutes under normal conditions.
In particular, the control of the headway is a fundamental problem in the regulation of the PTS [8], which can efficiently serve when trains arrive at stations according to regular time intervals [9]; however, a configuration of equal headways, although desirable, is intrinsically unstable [10,11]. The equal headway instability is triggered by trains moving faster or slower than expected and the rapid change of the passenger's demand [12]; this result in a "bunching" phenomenon [13]. In the MXM, a stop-skipping scheme is applied in overcrowded situations, i.e., an empty train is sent from the dispatching terminal to the saturated station directly to reduce the passenger overload and maintain a regular headway. For this, a previous schedule planning is established and human operational intervention is required. An optimized approach using Genetic Algorithms to applied stop-skipping scheme has been proposed [14] and an online learning approach using real-time information [15], while predictive models using support vector machines [16] and transit smart card data [17], have been proposed to reduce and eliminate bus bunching. A factor to promote the headway instability is the overcrowding phenomenon; Li, et al. [18] proposed a method to predict the short-term passenger flow and contribute to crowd control measures.
The last approaches try to predict and face the stochastic dynamics of PTS. Nevertheless, some of the proposed improvements require a significant amount of resources supported by a suitable infrastructure.
This motivates the interest to regulate PTS from an adaptive perspective, trying to maintain and even recover equal headways. For instance Bartholdi and Eisenstein [13], use a self-equalized schema to generate a natural headway; Liang, et al. [19] propose a self-adaptive method to equalize headway by using local information to introduce a little slack time in a single line automatically; Daganzo [11] uses an adaptive control with information of the headway in real time to determines bus holding times; and Daganzo and Pilachowski [20] use cooperation between trains to adjust their cruising speed. One way to make the headway stable is using adaptive [10] or self-organizing methods [21]; in these previous works, we proposed regulatory methods to conserve and restore headways using abstract simulations with discrete time and space and normalized variables such as speed and passenger influx; it was shown that a selforganizing method can adjust waiting time intervals of trains in stations considering only local information; if the delay occurs in an inter-station segment, the self-organizing method can correct the headway when the train arrives at the station. These methods can achieve supraoptimal performance due to the slower-is-faster effect [22]: passengers may wait more time at stations, but once on trains, most probably they will reach their destination faster, as vehicles do not try to keep strict equal headways.
This paper presents two regulatory headway control methods using the alighting and boarding time of passenger as a common basis. We refer to the first as the General Method (GM) (Fig 1A), which models the current dynamics of the headway of MXM through a minimum and maximum waiting time of trains at stations and a delay factor caused by the inflow and behavior of passengers in static and global context. The second is the Self-Organizing II Method (SOM-II) (Fig 1B) which is based on a previous self-organizing method [21] (Fig 1C) to regulate in an adaptive, local and decentralized manner the headway by using an antipheromone concept and the estimated time of arrival of the next train with a suitable balance of the variables to achieve self-organization.
The SOM-II may reduce the headway to a supra-optimal value as stipulated by inequality of Eq 1, as it adapts to the local flow of passengers and has the capacity to adapt the headway saving time in the passenger's travel by avoiding vehicle idling.
headway SOMÀ II ⩽ headway optimal ⩽ headway real ð1Þ A computer simulation was developed to test the performance of both regulatory methods. Agent-based modeling (ABM) [23] and the NetLogo programming environment [24] were used. The reader can download the source code at https://github.com/gcarreon/pts-simulator.
Current data of the MXM Line 1 (pink) was used to feed the parameters to the computer simulation. This information was obtained empirically through recording and analyzing videos manually processed. The computer simulation considers three general processes: 1. dynamics of passengers, 2. train flow, and 3. regulatory methods.
Peter Gipps' vehicular car-following model [25] was adapted to characterize the train flow, as detailed below. This model was extended with a sensor to identify agents in the line of vision https://doi.org/10.1371/journal.pone.0190100.g001 Improving public transportation systems with self-organization to modify the behavior of the trains suitably. Also, a safe distance between trains was defined and autonomous braking through a "phantom object" strategy [26] was implemented.
The computer simulation supports two general conclusions: 1. the GM (Fig 1A) shows a high correlation with the observed dynamic of the headway in the MXM; and, 2. the SOM-II ( Fig 1B) has a better performance than the GM, since it maintains regular headways in normal circumstances and restores them in the presence of perturbations. These results suggest that the improvement obtained with the SOM-II method in the simulation could be also observed in real systems if implemented, for which technology is available. Details of the methodology are presented. The Results section show the efficiency of the regulatory methods with its validation, followed by a Discussion. The description of an experiment pilot perform in MXM to regulate the alighting and boarding of passengers is described. Recommendations to improve PTS are finally presented.

Methods
Our computational methods consist of two parts: the first is the method to regulate the dynamics for each train at the station, which has two modalities: 1. The GM, and 2. the SOM-II. The second part is an extension of Gipps' model to characterize the dynamics of the train's flow and the interaction with agents in the environment. This block starts with the arrival of the train at the station and stops due to a traffic light in red (all trains stop at each station). Each time that a new passenger is added to the simulation, a new registry is created with her origin and destination station following a probability distribution according to the real average's passenger flow data from each station. This journey is calculated a priori based on this empirical information.
Each train has a control vector which records the path of the passengers. When a train arrives at a station; passengers who have ended their journey are identified and prepare for alighting. The estimated time for alighting and boarding is calculated in each station, ETAboard, from the number of passengers that alight and those who are in the platform to aboard; the total number of passengers are divided by four to model the four doors of the wagon. ETAboard is delimited by the minimum and maximum waiting time in the station, T min ETAboard T max ; these boundaries are set globally in the system with values empirically obtained. For instance, when there are no passengers to alight or board, the train will remain in the station time T min . Alternatively, if an overcrowded situation occurs, the train will stay until the maximum time T max is reached. Alighting and boarding of passengers has a rate of one passenger per second; for example, if at a station there are 50 passengers alighting and 30 passengers boarding, then the train will wait 80/4 = 20 seconds (30 ticks). The cycle concludes when the estimated time ETAboard is reached. The train departure is determined by the regulation method, either GM (left side) or SOM-II (right side) (Fig 3A and 3B).

General method
The dwell time is defined as the sum of the alighting and boarding of passengers at the station k using a constant rate [12] and a delay factor modeled with a Poisson distribution with mean λ r , which represents the delay of the boarding process and potential crowding effects. Other studies considered the fare payment method [27] and automatic passenger counting and vehicle location data [28], but in MXM the payment method is at the station's entrance and automatic passenger counting is not available.
When the alighting and boarding process concludes, a delay factor λ r is applied as defined in the lower branch (in black), on the left in Fig 3A. The DelayTimeDeparture procedure delays the departure based on a Poisson distribution with mean λ r seconds. The TrainDepartsStation function changes the traffic light to green so the train leaves the station. Subsequently, the traffic light changes to red to receive the next train. The previous section showed that the dynamic' MXM could be modeled with appropriate parameter values T min , T max y λ r .

Self-organizing II method
The Self-organizing II method regulates by adapting the time of the train in the station. This method uses the anti-pheromone concept [21], evoking the communication of social insects through the environment [29,30]. A variable assigned to each station represents the anti-pheromone; its value is zero once the simulation starts and increases at a growth rate of 2/3 per iteration. It is initialized to zero each time a train leaves the station. This value represents the elapsed time since the previous train left. This process is included in the right-upper red block in The mechanism to determine if the train departs or stays is the result of the comparison between the antipheromone value and the estimated time of arrival of the next train, ETNext-Train; see the low part (in red) on the right side of Fig 3. This value is calculated based on the distance between trains T n−1 and T n -which can be measured by a sensor-and the average speed of train T n , considering the last k iterations as stipulated by Eq 2: where d(x n (t), x n−1 (t)), is the Euclidean distance at time t between the position x n−1 of the train located at the station and the position x n of the next train T n−1 ; " v n ðt; kÞ is the average speed of the train T n during the last k iterations in function of time t. When the anti-pheromone value is more than or equal to ETNextTrain, the condition to depart is accomplished, then the train leaves the station and the anti-pheromone value is reset. The balance between these two variables makes it possible that the train preserves and restores the headway in a decentralized way using local information, but can also adapt to changes in the system. The behavior can be summarized in two main situations: 1. When the anti-pheromone value is high and the ETNext-Train is low, this indicates that the train ahead departed long ago and the train behind will arrive soon; for this reason, the train in the station can depart. 2. If the anti-pheromone value is low and the ETNextTrain is high, the train in the station will have to wait until the next train is closer or the previous train is farther. The video https://youtu.be/1AS9dWdr6kk shows a headway regulation experiment using SOM-II. It starts with a configuration of the trains accumulated one behind the other and ends up with almost equal headways. Fig 5 displays the NetLogo simulator along with signs and graphics to observe the system performance. The reader can access the simulator and source code at https://github.com/gcarreon/pts-simulator.

Extended Gipps model
The simulation uses an extension of Gipps' car-following model [25] to characterize the train flow with three main external adjustments: 1. A line of vision that allows the train identify the agent ahead (i.e., trains or traffic lights); 2. A safe distance between trains and; 3. An autonomous brake using the "phantom object" strategy [26]. The model considers discrete time and continuous space. The equation to calculate the speed at time t + τ is: G a ðtÞ ¼ u n ðtÞ þ 2:5a n tð1 À u n ðtÞ=V n Þ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 0:025 þ u n ðtÞ=V n p ; ð4Þ where a n is the maximum acceleration which the driver of vehicle n wishes to undertake; b n is the most severe braking event that the driver of vehicle n can make (b n < 0); s n is the effective size of vehicle n, V n is the desired speed of vehicle n, x n (t) is the location of the front of vehicle n at time t,b is the value of b n−1 estimated by the driver of vehicle n which cannot be known from direct observation; u n (t) is the speed vehicle n at time t, and τ is the apparent reaction time which is constant for all vehicles. Eqs 4 and 5 represent the acceleration and deceleration respectively, which are compared to update the new speed u n (t + τ) according to the distance of the object in front. The update of The reaction time of the driver described by τ, is commonly set at 2/3 of a second. The simulation tick's value is taken form this parameter. The physical characteristics of the train flow are described directly by the parameters of the model; this allows to set the values that are empirically obtained.

Extension 1: Line of vision
A new parameter, called line of vision, allows the train to identify the trains or the traffic lights ahead of it. If the agent is within the line of vision, the distance is calculated to determine the behavior of the train (Fig 6). For instance, if there is a train ahead, Eq 3 is executed; if there is a traffic light in green or red a Eqs 4 or 5 is computed respectively. And if there are both in the line of vision then the minimum distance to the agent is considered. If no agent is found, then Eq 4 is computed.

Extension 2: Safe distance
A minimum safe distance was defined; this is a fundamental operational rule in PTS, so trains do not set too close one behind the other, as in the original model. The expression to calculate the distance is part of the deceleration equation (Ec.5), which becomes (Ec.7), as follows: The safe distance can be seen as an increment of the effective size of the train S n to model the space between trains. It remains constant for all trains and the value of the parameter is equal to the train length, i.e. 150 meters.

Extension 3: Autonomous braking
Autonomous braking using the "phantom object" strategy is used without modifying the original Gipps' Model. An object of size zero is placed at position x n−1 and time t in the optimal distance for the train to begin braking immediately. To find the correct position, a systematic and exhaustive search in the parameter space of V (desired speed) and b (brake) was performed. The elapsed time and distance before the train stops completely were measured (Fig 7). This functionality allows braking at any time and, as a consequence, offers the possibility of decreasing the desired speed by braking and then setting the new V when this value is reached. This extension was used to simulate possible mechanical failures of specific trains, for example, reducing the train's desired speed to zero to test how the regulatory methods react under these circumstances.
Parameter values of acceleration and braking were optimized to represent the dynamical properties of MXM trains adequately through an exhaustive and systematic parameter search. Maximum speed, estimated braking of the train ahead, security distance, vehicle size, line of vision, safe distance and reaction time of driver were set according to appropriate realistic values. Table 1 resumes this information.

Results
We used the profile of the Line 1 (pink) of the MXM to test the performance of the regulatory methods, considering realistic distances, velocities, number of trains, and passenger demands. In the computer simulation, time is measured by ticks, where each tick corresponds to 2/3 of a second. The spatial unit is called patch, where each patch represents 150 meters. The time for updating Gipps' model and the regulatory methods, and the length of the train, coincides with the value of the ticks and the size of the patch respectively. The values of the parameters of Gipps' model, such as the speed, the acceleration, and deceleration, were established from a systematic and exhaustive search in the parameter's space using the values that better adjusted to mechanical properties of the trains.
A cyclic line with the following elements was built: a railroad line of 19.5 kilometers; 20 stations with length of 150 meters distributed with the real inter-station segments of Line 1, (from Pantitlán station to Observatorio station); 16 trains equidistantly distributed along the  line and traffic lights at each station. Each passenger's travel was modeled with probabilities P arrival k and P departure k of arriving and departing at station k respectively. The set of all passenger's travel models origin-destination flows. A sample of the average flow per station in the MXM contributed to define these probabilities. Intervals among arrivals of passengers at the station followed a Poisson distribution with an average of λ p ticks. Low (e.g. λ p = 1) and high (e.g. λ p = 20) values of λ p model a high and low number of arrivals per period of time respectively. For example, if λ p = 5, a new passenger arrives at the k station every 5/P arrival k ticks on average. Trains consist of one car with capacity of 180 passengers and only one door, as the results are scalable up to the 36 doors in the real train (four per each of nine wagons). According to empirical observations, the time of alighting and boarding is proportional to 1 passenger per second per door on average.
The GM considers three parameters: the minimum and maximum waiting time of the train at the station T min and T max respectively, and a Poisson distribution with mean λ r that represents the delay due to passengers or caused by a late departure of the train. A point of measurement illustrated with orange mark on the line (Fig 8) was located to generate frequency histograms of time intervals between trains at such location (Pino Suárez station), that we called the headway distributions.
The headway distribution was obtained through 299 data measurements (Fig 9A) obtained from 12 hours of video recordings during high attendance or peak hours. Due to the instability of the phenomenon and in order to highlight the qualitative properties over the quantitative ones, we used time windows of 20 seconds in the histogram.
A systematic and exhaustive search over space T min , T max , and λ r took place to find the values that better adjust to the real headway distribution. The ranges of the search were established from empirical measurements, considering a minimum and maximum waiting times in seconds and the delay in departure, which are 16 ⩽ T min ⩽ 40, 20 ⩽ T max ⩽ 200 and λ r = {3, 6} respectively. For each possible vector (T min , T max , λ r ) we ran the simulation until the headway distributions with 299 headway measurements was obtained. The Pearson correlation coefficient was subsequently calculated. The optimum values are: T min = 24, T max = 80, and λ r = 3, which reached a maximum Pearson correlation coefficient of 0.98 (Fig 9B, see below). In the real system, the headway may be exceptionally longer than 7 minutes due to mechanic failures; however, in the simulation the maximum headway was about 4 minutes.
The initial conditions considered empty trains and stations and trains placed equidistantly along the line. The simulation was run a hundred times with the best set of parameters (T min = 24, T max = 200, λ r = 3) and different random seeds to observe statistical variations of Pearson's correlation coefficient between GM simulations and the real headway. The histogram (Fig 10) shows that the maximum correlation value is 0.98 and the mean is 0.87 with standard deviation 0.06 for the 100 experiments. The statistical variation is produced by the probability distribution of the arriving and departing of passengers in the stations and the delay in the departure of the trains.
The performance of the SOM-II substantially improves the headway stability ( Fig 11A) in relation to GM (Fig 9B). The histogram of the headway frequencies shows a mean of 110 seconds, which are 5 to 10 seconds less than the theoretical optimal headway, which is 115-120 seconds for Line 1 in low demand conditions according to the operational personnel (although there is not official document sustaining such opinions); therefore, the inequality of Eq 1 holds. The SOM-II adapts to local changes produced by the influx of passengers. The time series of the headway shows high fluctuations at the initial values but the trains adapt to a supra-optimal configuration after about 40 to 50 minutes (Fig 11B). The small differences in headway values are produced by the passenger influx variation.
The performance of SOM-II and GM can be compared with averaged measures; we consider passengers' travel time, passenger' exit flow, passenger speed, and train speed. The control parameter is the passenger's influx λ p as defined at the beginning of the section and varied in the interval 2 ⩽ λ p ⩽ 10. For each λ p value the simulation was run for 100,000 iterations; to discard transient dynamics, the first 30,000 iterations were not considered. To keep consistency with the previous results, the same parameters of both regulatory methods and the Gipps' model were used. Fig 12 shows the results of the performance.
The GM decrease its performance when λ p < 7 (Fig 12A), since the average passengers' travel time starts increasing due to the system's saturation. For example the first and second station in the line, Pantitlán and Zaragoza, have the highest probability of passenger arrival, but the overcrowding phenomenon starts in the stations Salto del Agua and Balderas, positions 11 and 12 respectively over the line and then impact negatively to other stations. The pattern of propagation of station overcrowding depends of the alighting and boarding probabilities at each station. The average speed of passengers ( Fig 12C) and the average speed of trains decreases (Fig 12D) when λ p = 6; the performance of the SOM-II decreases for λ p < 5 ( Fig  12A, 12C and 12D), which implies a capacity increase of the transportation system through headway regulation in average 20% for λ p < 5 (Fig 12B).
In order to test the headway resilience capacity of GM and SOM-II, the following experiment was devised: the system with initial condition as mentioned before was interrupted in the minute 209 by stopping the train 0 for 15 minutes before the headway measure point, the stop time interval start and finalize with t i and t r respectively, shown with red dashed lines in Figs 13 and 14, which resulted in the formation of a train cluster of size 10 with a safe distance of 300 meters between them, respecting an operational rule in the MXM (Fig 14).
After that, the stopped train restarts its flow. On the one hand, the time series of GM shows that the headway cannot restore its previous dynamics as a convoy of aggregated trains is https://doi.org/10.1371/journal.pone.0190100.g013 Improving public transportation systems with self-organization formed with interval separation of 16 to 20 minutes and the system needs external intervention to recover; the time spent by the train 0 to arrive at the headway measuring point is 16.59 minutes (depicted by the first peak in Fig 13A), while the minimum headway value is 1.28 minutes due to the main cluster formation (Fig 14A).
The passenger accumulation is increased at stations due to the service interruption. The accumulating trains can stopped at stations or between them. In the first case, the dwell time can exceed the maximum waiting time at stations T max . Still, passengers can board the train until its maximum capacity is reached or the service is restored.
On the other hand, the time series of SOM-II shows a rapid recovery of the headway; at the restoration of the service, a gap of 14.60 minutes is formed, but decreases until it recovers by itself completely in about 50 minutes (Fig 13B), the mean value of the headway is 2.4 minutes with standard deviation 0.72 and minimum value 1.84 minutes, which are values within the operational range.

Discussion
This paper presented two methods to regulate public transportation systems; the General method (GM) and the Self-Organizing II method (SOM-II). The results of GM correlated well with the headway data collected empirically in the MXM. Calibrating and validating our computational methods in this way, we can argue that results of SOM-II are reliable. We can expect that in case of implementing this method in a real system, an improvement in average journey time of approximately 20% and a decrease of 25% in mean headway values, as well as the ability to maintain and recover regular headways.
The GM models the headway distribution of MXM based on minimum and maximum waiting time of train at stations and a delay component λ r . A Poisson distribution with mean λ p represents the time between passenger arrivals in the system. The appropriate values of the parameter's simulation produce a high correlation with the empirical measurements carried out in the MXM. The model shows that the system has a low performance due to an inadequate regulation of the headway. The factors that influence the headway instability are the station overcrowding, which affects the boarding and alighting time, and the time departure of the train. To isolate the components that promote delays and analyze the behavior of the headway, we explored a scenario without delay and a low influx of passengers; that is for example, λ r = 0 and λ p > 10; the time average for a journey improved to 10%. However, the headway values reflect a poor performance of the system.
The system regulated with GM exceeds its capacity when λ p 6 (high influx of passengers). In this condition, the performance decreases and trains cluster. This characteristic is also observed within other models [10,31,32]. On the contrary, the SOM-II shows a superior performance, seemingly better that the theoretical optimum [21]. It was also shown that the headway is recovered and preserved under any initial distribution of trains, even in a cluster configuration. With values of a high saturation of passengers such as λ p = 5, the headway remains stable and the system capacity is increased, compared with GM ( Fig 12A).
The SOM-II eliminates effectively the equal headway instability, i.e. it reduces bus-bunching by 100%, adaptively adjusting the waiting time at stations. For λ p ! 7, SOM-II improves over GM the average travel time of passengers by 18%. For λ p = 6, the improvement is of 34%; for λ p = 5, 79%; while the improvement is of 67% for λ p = 4. Overcrowding occurs with GM for λ p 6 and with SOM-II for λ p 4. The system collapses with GM for λ p 5 and with SOM-II for λ p 3. The present results can be compared with the the work presented in [15] in which online learning and simulation approach showed a bus-bunching reduction rate of 65% and a reduction of waiting time at stations of about 4.5%. As future work, our proposal could be combined with a stop-skipping scheme [14]to reduce overcrowding at stations.
Computer simulations are useful for studying public transportation systems, as one can: 1. Explore different scenarios; for instance, to accurately simulate failures of trains, to use functions for the probability of arrival of passengers or implement strategies of dosage of empty trains to serve overcrowded stations; 2. Estimate the stability of the headway from initial conditions that along with real time information systems allows performance estimations all day, and 3. Scale and model the complete PTS, for example, to analyze the dynamics of transfer stations. This model considers parameters and relevant processes to regulate the headway and influence the real phenomenon, although it is not the intention to give a detailed description of all processes and variables that participate in PTS dynamics.

The Mexico City Metro
The delay parameter λ r considered in the simulation represents three observed dynamics in MXM: 1. the possible delay in the process of boarding and alighting; 2. the delay caused by closing doors due to saturation and inappropriate passenger behavior; and, 3. Delays in the departure of the trains possibly due to train's cluster formation. The first two points can be dealt with an adequate boarding strategy to guide passenger behavior; while the third can be regulated implementing SOM-II.
The ideas considered in this work and the empirical observations and measurements encouraged the development of a pilot experiment, installed on December 4th, 2016 at Balderas station of Line 1 of the MXM. which consisted of placing guide signs on the platform (Fig 15) to regulate the flows of boarding and alighting of passengers and minimize the dwell time. We considered the following components of the dwell time: the time of alighting and boarding of passengers; the remaining time of the open doors when the passenger can still alight or board; and the delay in the door closing process which represents a significant delay during overcrowding. In the MXM under normal conditions, the door closing process takes two or tree seconds, while in overcrowding conditions it can reach 55 seconds due to passenger behavior.
The signs allow users to identify the position of the doors before a train arrives at the station and wait in zones to avoid any obstruction of alighting passengers. Users gathered at any of the two waiting zones, and when the train arrives passengers alight without any obstruction; subsequently, users waiting at the platform can board in two simultaneous flows, and those who cannot achieve it will remain at the waiting zone (Fig 16).
The following are the results of the study: 1. Conflicts and pushes during the boarding and alighting were eliminated almost entirely; 2. The time of boarding and alighting reduced about 10 to 15%; 3. The obstructions when closing the doors were reduced about 15 to 25%, and 4. Users positively adopted the regulation strategy.
We expected that passengers would group into clusters to board the train; however, they spontaneously formed a lines (Fig 16). This increased order and consequently a significant reduction of conflicts and pushes. This "first come, first board" dynamic was disseminated and became an accepted rule. The regulatory method was satisfactorily implemented, and because of this, it has been spread to other Metro stations. The method accelerated the boarding and alighting of passengers in high influx stations, such as transfer stations. This new low-costhigh-impact scheme shows a real benefit on the quality of travel and is generating a change in the passenger culture. The reader is invited to see the videos of the project at the URLs https:// youtu.be/eoXsvYQ8H_s and https://youtu.be/kshOlqJU3Hs. • Place suitable guide signs on the platform. With this information, users will move correctly and will be sure about the position of the doors and avoid obstructions for alighting passengers. Caracas, Río de Janeiro, Dubai, Hong Kong, Singapur, Tokio, Seoul, Beijing, Montreal, Munich, Boston, Mexico City, and other cities currently have schemes of signs on the platform.
• Enable real time information systems about the time of waiting and available space on trains, which would make easier for users to decide the alternative routes to use in case of saturation. There are mobile applications that could help with this task.
• Raise awareness among passengers through information campaigns to promote a proper use of the services and the implications of bad behavior, and also to explain basic concepts of operation, such as the equal headway instability and the slower-is-faster effect [22].
• Use a computer simulation to short-term predict critical situations, to prevent system collapse, and take appropriate actions.
• Design methods to control and regulate headways. The SOM-II is feasible for its implementation as it would substantially improve the service and would help to increase the thresholds of a system collapse about a 25%.

Conclusion
The headway distribution was considered as an indicator to measure the performance of public transportation systems. The Self-Organizing Method II shows that with appropriate local interaction rules, it is possible to regulate the headway globally and adaptively. The method uses variables with an explicit representation of the real phenomenon, which indicates a guide for the technological implementation and its possible regulation. In addition, we consider that the passenger dynamics directly impact the achievement of the service. The pilot experiment carried out in the Mexico City Metro showed that a change of interaction rules among passengers can improve the system considerably. The local and global interaction mediators allow reducing delays and an adaptive service regulation.