This study aims to investigate how artificial intelligence can enhance the resilience and efficiency of railway timetables in disruption-prone commuter corridors. Specifically, it focuses on Moroccan railway networks connecting Casablanca, Mohammedia, and Rabat, where recurrent delays and congestion compromise service reliability. The research seeks to determine how integrating predictive delay modeling with adaptive passenger behavior can reduce secondary delays, alleviate congestion, and maintain timetable stability under operational disturbances.
A unified, simulation-based framework was developed, combining 3 interlinked modules: (1) machine learning-based predictive delay forecasting, (2) agent-based modeling of passenger adaptive behavior, and (3) dynamic timetable reoptimization using a rolling-horizon heuristic approach. The framework operates as a closed-loop system, where predicted delays and simulated passenger responses continuously inform real-time timetable adjustments. Empirical validation was conducted using operational data from Moroccan commuter trains, with scenario-based analysis comparing baseline, prediction-only, and fully integrated interventions.
Results show that the fully integrated framework significantly improves operational performance. Average train delays were reduced by 46%, total passenger waiting time decreased by 43%, and congestion intensity was nearly halved, while timetable stability remained high at 95%. The study also demonstrates that passenger behavior plays a critical role in delay propagation, and that combining predictive forecasting with adaptive control strategies prevents the nonlinear amplification of secondary delays that traditional train-centric models fail to address.
This research advances the field of railway operations by presenting a passenger-centered, AI-driven timetable reoptimization framework that integrates predictive analytics and behavioral simulation within a dynamic feedback loop. Unlike conventional models, it captures emergent congestion patterns, anticipates disruptions proactively, and provides actionable operational strategies without requiring major infrastructure expansion. The study offers a novel methodological contribution with practical implications for enhancing commuter railway resilience in high-density, disruption-prone contexts.
1. Introduction
Rail transport plays a crucial role in Morocco's urban and intercity mobility, connecting major cities such as Casablanca, Mohammedia, and Rabat, (Salhi, Benhsain, & Boujrouf, 2024). Every day, thousands of commuters, students, and professionals rely on the railway network for timely and reliable transportation. Despite significant modernization efforts, the Moroccan railway system, operated primarily by ONCF (Office National des Chemins de Fer), continues to face recurrent operational disruptions (Hoummirat & Blayac, 2025). These disruptions can be caused by maintenance works, technical failures, environmental conditions such as floods, or accidents along the tracks. Observations from daily users and social media reports indicate that delays often range from 30 minutes to over 5 hours, causing cascading effects on passenger flow, overcrowding, and overall service satisfaction (Monsuur, Enoch, Quddus, & Meek, 2021). For instance, passengers attempting to catch trains during peak hours frequently find themselves unable to board due to capacity constraints, forcing them to take later trains and inadvertently increasing congestion on subsequent services.
Traditional approaches to railway timetable optimization have focused predominantly on infrastructure and train-to-train scheduling, often neglecting the dynamic responses of passengers to unexpected delays (Dai et al., 2021). This gap creates operational inefficiencies: delayed trains trigger secondary delays, overcrowding intensifies, and passengers may alter their travel behavior in unpredictable ways. Therefore, a comprehensive understanding of railway operations must integrate both train performance data and adaptive passenger behavior in order to design more resilient and efficient scheduling strategies.
This research contributes to the field of railway operations and logistics by proposing a novel AI-based framework for dynamic timetable reoptimization. Unlike conventional models, this approach combines predictive analytics for delay anticipation with agent-based modeling (ABM) of passenger behavior, enabling railway operators to simulate, anticipate, and mitigate the consequences of disruptions in real time. By integrating passenger adaptation patterns–such as choosing alternative trains, rescheduling trips, or altering boarding behavior–our model provides a more realistic and actionable optimization strategy.
The primary objective of this study is to develop an intelligent system capable of reconfiguring railway schedules dynamically under major operational disruptions while minimizing secondary delays, congestion, and service degradation. Specifically, this research addresses the following questions.
How can artificial intelligence be leveraged to predict and mitigate primary train delays caused by maintenance, accidents, or environmental factors?
How does incorporating adaptive passenger behavior into timetable reoptimization impact congestion, secondary delays, and overall network efficiency?
What are the operational benefits of AI-driven dynamic re-scheduling compared to traditional timetable adjustment methods in Moroccan railway networks?
The structure of this article is organized as follows. Section 2 offers a thorough review of the literature, covering railway timetable optimization, models of passenger behavior under operational disruptions, and the application of artificial intelligence in transportation systems. Section 3 describes the research methodology, detailing the machine learning techniques employed for delay prediction and the ABM approach used to simulate adaptive passenger responses. Section 4 presents the empirical results and discussion, beginning with the evaluation of predictive delay modeling, followed by an analysis of passenger behavior simulation, and concluding with the performance assessment of the dynamic timetable reoptimization framework. This section highlights how the integration of AI-based forecasts and agent-based passenger modeling influences delay propagation, congestion, and overall operational efficiency. Section 5 synthesizes these findings in a comprehensive conclusion, outlining the study's contributions, practical implications for railway management, limitations, and potential directions for future research aimed at improving resilience and passenger experience in commuter railway networks.
2. Literature review
2.1 Railway timetable optimization and railway system robustness
Railway timetable optimization constitutes a foundational pillar of railway operations research, particularly in high-density commuter corridors where infrastructure capacity is constrained and service regularity is essential. Classical railway scheduling approaches aim to maximize network efficiency by minimizing total travel time, reducing conflicts between train paths, and optimizing headways within limited track resources (Garrisi & Cervelló-Pastor, 2020). These models, often formulated through mixed-integer linear programming or network flow optimization techniques, are primarily designed under deterministic assumptions in which train movements and demand levels are considered predictable (Taslimi, Sarijaloo, Liu, & Pardalos, 2022). While such frameworks achieve high operational performance under nominal conditions, they exhibit structural fragility when confronted with unexpected disruptions such as maintenance works, technical failures, or environmental disturbances.
As railway systems operate closer to their capacity limits, the trade-off between efficiency and robustness becomes increasingly critical. Robust timetable design attempts to incorporate buffer times and recovery margins to absorb stochastic variability without propagating delays across the network. However, excessive buffering reduces infrastructure utilization and service frequency, which is particularly problematic in commuter railway systems with strong peak-hour demand, such as the corridors connecting Casablanca, Mohammedia, and Rabat. Empirical evidence suggests that when disruptions exceed predefined recovery margins, delay propagation follows nonlinear patterns driven by interdependencies among train sequences, shared tracks, and rolling stock rotations (Bešinović, 2020). Traditional robustness strategies largely concentrate on train-to-train interactions and infrastructure constraints, yet they insufficiently account for the systemic influence of passenger accumulation and congestion (Safitri, Harjono, Hasrito, & Roestam, 2024). Therefore, railway timetable resilience must be reconceptualized as a dynamic property emerging from the interaction between operational supply mechanisms and fluctuating passenger demand.
2.2 Railway passenger behavior and congestion dynamics under disruptions
The evolution of railway operations research has progressively acknowledged that passengers are not passive entities within the system but active agents whose adaptive behavior significantly influences operational outcomes (Li et al., 2023a; El Moussaoui and El Moussaoui, 2026a, 2026b). Earlier models treated passenger demand as an exogenous and temporally fixed variable, assuming stable boarding patterns and predictable flow distributions. However, real-world disruptions reveal that passengers continuously adjust their decisions in response to service irregularities (Pang, Wang, Wang, Li, & Peng, 2023). When trains are delayed or canceled, travelers may alter departure times, reposition strategically on platforms, compete for limited carriage space, or select alternative services. These adaptive behaviors generate emergent congestion patterns that directly affect dwell times, train occupancy, and subsequent service punctuality (Chen, Luo, Chen, & He, 2023).
In commuter railway networks characterized by high passenger density, disruption-induced congestion exhibits nonlinear amplification mechanisms. When a primary delay occurs, passenger inflow often continues according to planned schedules, creating an imbalance between expected and actual service capacity. As accumulated passengers exceed boarding capacity thresholds, dwell times extend beyond planned durations, thereby generating secondary delays (Kuipers, Palmqvist, Olsson, & Winslott Hiselius, 2021; Kuipers, 2024; El Moussaoui & El Moussaoui, 2026a, 2026b). This feedback loop between congestion and operational delay intensifies during peak periods, where even minor disturbances can escalate into large-scale service degradation. Furthermore, uncertainty regarding arrival times and limited real-time information can exacerbate behavioral variability, increasing competition for boarding and spatial crowding on platforms (Seriani et al., 2025). These dynamics demonstrate that railway delay propagation cannot be fully understood without integrating adaptive passenger behavior into scheduling frameworks (Sharma, Pellegrini, Rodriguez, & Chaudhary, 2023). ABM has therefore gained prominence as a methodological approach capable of capturing heterogeneous decision-making processes and simulating the emergent consequences of collective behavioral adaptation within railway environments.
2.3 Artificial intelligence in railway delay prediction and dynamic rescheduling
The integration of Artificial Intelligence into railway operations has introduced transformative capabilities in predictive analytics and decision support systems (Li, Xue, Shao, Zhu, & Liu, 2023b). Machine learning algorithms have demonstrated strong performance in forecasting primary train delays by analyzing historical operational data, environmental conditions, infrastructure characteristics, and traffic density indicators (Singh & Kumar, 2026). These predictive models enhance situational awareness by identifying potential disruptions before they fully materialize, thereby providing railway operators with valuable time for proactive intervention. Nevertheless, predictive accuracy alone does not guarantee effective disruption mitigation. Without mechanisms to translate predictive insights into dynamic timetable adjustments, AI systems remain limited to diagnostic functions rather than operational control tools (Zhang & Zhang, 2023).
Recent research has therefore shifted toward AI-driven dynamic rescheduling frameworks that integrate predictive outputs into real-time optimization processes (Sarp, Kuzlu, Jovanovic, Polat, & Guler, 2024). Reinforcement learning and adaptive control strategies enable railway systems to iteratively adjust departure times, modify headways, and reallocate rolling stock based on evolving network conditions (Yin, Liu, Chang, Fu, & Wu, 2025). However, many of these AI-based rescheduling approaches remain predominantly train-centric, focusing on minimizing aggregate delay while neglecting passenger-induced congestion externalities (König, 2020). In high-demand railway corridors, such omissions may lead to suboptimal outcomes where delay reduction at the train level inadvertently intensifies overcrowding and service dissatisfaction. Consequently, there is a growing need for integrated AI architectures capable of jointly modeling delay prediction, passenger flow adaptation, and timetable reoptimization within a unified decision-making framework. Such integration aligns operational performance metrics with passenger-centered indicators, enhancing both efficiency and resilience in disruption scenarios.
2.4 Research gaps in AI-driven railway timetable reoptimization
Despite significant advancements in railway timetable optimization and AI-based delay prediction, several critical research gaps persist. First, existing literature frequently separates predictive modeling from operational rescheduling, resulting in fragmented decision architectures. Machine learning tools often provide delay forecasts without being embedded within closed-loop systems capable of dynamically recalibrating timetables in real time. This separation limits the practical impact of AI applications in railway disruption management.
Second, the majority of current AI frameworks adopt a supply-oriented perspective that prioritizes train-level performance indicators while treating passenger demand as static or externally determined. Such simplifications overlook the endogenous feedback mechanisms through which adaptive passenger behavior amplifies dwell times and secondary delays. The absence of behavioral integration creates a structural limitation in existing rescheduling models, particularly in commuter railway contexts where passenger density plays a decisive role in system stability.
Third, unified frameworks that combine predictive analytics, agent-based behavioral modeling, and dynamic timetable optimization remain underdeveloped. Most studies examine these components independently rather than constructing integrated architectures capable of learning from disruption patterns and continuously adapting operational strategies. This fragmentation is particularly problematic in capacity-constrained railway networks characterized by high demand volatility and recurrent large-scale delays.
Finally, empirical applications of AI-based integrated rescheduling systems in emerging railway environments are scarce. Much of the literature is validated in highly digitized systems with extensive monitoring infrastructures and operational buffers, whereas networks operating under tighter capacity margins require context-sensitive intelligent solutions. Addressing these limitations necessitates the development of an AI-driven, passenger-centered railway timetable reoptimization framework capable of anticipating primary disruptions, simulating adaptive passenger responses, and dynamically reconfiguring schedules to minimize secondary delays and congestion.
The present study addresses the identified research gaps by proposing an integrated intelligent system specifically designed for disruption-prone commuter railway networks. By combining predictive delay modeling with agent-based passenger simulation within a unified optimization framework, this research advances a multidimensional approach to railway resilience that simultaneously enhances operational efficiency and passenger experience. Building on the theoretical and methodological insights highlighted in the literature, the following section presents the research methodology adopted in this study. Section 3 details the architecture of the proposed AI-based railway timetable reoptimization framework, describing the machine learning algorithms used for delay prediction, the ABM structure employed to simulate adaptive passenger behavior, and the optimization procedures implemented for dynamic schedule reconfiguration. This methodological design operationalizes the integrated approach advocated in the literature and provides the analytical foundation for the empirical case study conducted on Moroccan railway data.
3. Research methodology
3.1 Research design and integrated framework architecture
This study adopts a quantitative and simulation-driven research methodology aimed at designing and empirically validating an AI-based railway timetable reoptimization system. The research logic is grounded in a systemic perspective, where railway performance is considered the result of continuous interactions between operational supply mechanisms and passenger demand dynamics. Rather than examining delay prediction, passenger adaptation, and timetable adjustment separately, the proposed methodology integrates these components within a unified decision-support architecture.
The framework is structured around 3 interdependent modules: predictive delay modeling, agent-based passenger simulation, and dynamic timetable reoptimization. These modules are connected through iterative feedback mechanisms, allowing predicted disruptions to influence passenger flow simulation outcomes, which subsequently inform operational scheduling adjustments. This closed-loop structure enables the system to move beyond reactive recovery strategies toward anticipatory and adaptive control.
To improve methodological transparency and ensure reproducibility, each module of the framework is explicitly formalized. The predictive delay component is defined as a supervised learning function → , where represents operational and contextual features (including headway variability, upstream cumulative delays, rolling stock dependencies, and congestion proxy indicators), and denotes the predicted primary delay. Two modeling approaches are implemented: an ensemble tree-based regressor and a recurrent neural network (RNN), allowing the capture of both nonlinear relationships and temporal dependencies in sequential train movements.
The passenger behavior module is modeled as a discrete-time agent-based system S = (A,E,R), where A denotes passenger agents, E the railway environment, and R the behavioral rules governing decision-making. Each agent is characterized by attributes including arrival time, destination, delay tolerance, and boarding strategy, enabling the simulation of heterogeneous behavioral responses.
The timetable reoptimization module is formulated as a constrained multi-objective optimization problem, activated based on operational thresholds derived from predicted delays and simulated congestion levels. The integration of these 3 modules within a feedback loop ensures that predictive outputs directly influence both behavioral dynamics and operational decisions.
The overall architecture of the proposed AI-driven railway timetable reoptimization framework is illustrated in Figure 1. The diagram highlights the interaction between predictive analytics, behavioral simulation, and dynamic scheduling decisions, all operating within a continuous real-time feedback loop.
Empirical validation is conducted using data from Moroccan commuter railway corridors connecting Casablanca, Mohammedia, and Rabat, operated by Office National des Chemins de Fer. These corridors present high passenger density, limited infrastructure redundancy, and recurrent operational disruptions, providing an appropriate test environment for resilience-oriented scheduling strategies.
The research design follows 4 main stages: (1) operational data preparation, (2) predictive delay modeling, (3) passenger behavioral simulation, and (4) optimization-based scenario evaluation. The following subsections detail each methodological component.
3.2 Data collection, processing, and predictive delay modeling
The empirical dataset consists of multi-source railway operational records, including planned and actual train arrival and departure times, dwell durations, headway intervals, rolling stock assignments, and detailed disruption logs. Disruption causes are categorized into maintenance activities, technical failures, environmental conditions, and operational conflicts. Station-level passenger throughput statistics were also incorporated to support congestion modeling.
The dataset covers a continuous observation period of 6 months, from August 2025 to January 2026, with a temporal granularity at the minute level for train movements. This period was selected to capture variability in operational conditions, including peak-hour congestion, regular service periods, and disruption events. The dataset includes observations from the main stations along the Casablanca-Mohammedia-Rabat corridor, ensuring strong spatial representativeness.
In total, the dataset comprises 8,742 train movement records and associated delay observations, along with 1,936 documented disruption events and synchronized station-level passenger flow measurements. Passenger flow data were aggregated based on entry and exit counts at stations, enabling the estimation of congestion levels and boarding pressure. These data were temporally aligned with train movement records to ensure consistency between operational and passenger-related variables.
Given the heterogeneity and potential inconsistencies of raw operational data, a structured preprocessing phase was conducted. Timestamp synchronization procedures aligned train movement records across stations. Missing delay values were estimated using interpolation techniques, and abnormal entries were filtered through statistical outlier detection. Continuous variables were normalized to stabilize model convergence, while categorical disruption causes were encoded numerically. Feature engineering techniques generated additional explanatory variables, including cumulative upstream delay indicators, train sequence position variables, congestion proxy measures, and rolling stock dependency metrics.
To enhance reproducibility, the variables used in the predictive modeling process include headway variability, upstream cumulative delays, rolling stock assignment dependencies, and congestion proxy indicators derived from passenger flow data. These variables are systematically structured and can be summarized in a dedicated table (Table 1) including definitions and data types.
The data transformation and predictive modeling workflow adopted in this study is summarized in Figure 2. The figure illustrates the progression from raw operational data to structured inputs for machine learning-based delay forecasting.
To forecast primary delays, supervised machine learning algorithms were implemented and compared. Ensemble tree-based regressors were first applied to capture nonlinear relationships between infrastructure, operational variables, and delay duration. Subsequently, RNN architectures were evaluated to capture temporal dependencies embedded in sequential train movements.
The predictive modeling procedure follows a structured pipeline including temporal data splitting into training, validation, and testing subsets, model training using historical sequences, hyperparameter optimization via grid-search techniques, and evaluation on unseen data. This procedure ensures methodological transparency and allows replication of the modeling process.
Model performance was assessed using Mean Absolute Error (MAE), Root Mean Square Error (RMSE), and the coefficient of determination (R2). A temporal data-splitting strategy was employed to prevent information leakage between training and testing phases. Hyperparameter optimization was conducted using systematic grid-search procedures.
The selected predictive model produces short-term delay forecasts prior to full disruption propagation. These forecasts serve as anticipatory inputs for the passenger simulation and reoptimization modules, enabling proactive operational interventions rather than purely reactive adjustments.
3.3 ABM behavior simulation
To capture adaptive passenger responses under disruption scenarios, an ABM framework was developed. In contrast to aggregate flow models that assume static demand distributions, the ABM approach represents passengers as autonomous agents whose decisions collectively shape congestion dynamics and delay propagation.
Each passenger agent is characterized by attributes including arrival time at station, intended destination, delay tolerance threshold, and boarding preference strategy. When disruptions occur, agents evaluate available alternatives according to a structured decision hierarchy: waiting for the delayed train, boarding the next arriving service, or postponing travel.
Formally, the decision-making process is modeled using a utility-based framework, where each passenger agent i selects an action α ∈ {wait,board,postpone} that maximizes a utility function Ui(α), depending on expected waiting time, congestion levels, and individual delay tolerance. This formulation allows the explicit representation of heterogeneous behavioral responses observed in real-world disruption scenarios.
Boarding competition is explicitly modeled through carriage capacity constraints. If occupancy limits are reached, excess passengers are reassigned to subsequent trains, generating accumulation effects on platforms.
The behavioral mechanisms embedded in the simulation are illustrated in Figure 3. The diagram demonstrates how passenger decisions under disruption conditions generate platform congestion, extended dwell times, and secondary delay propagation.
Dwell time extensions are dynamically calculated as a function of boarding and alighting volumes. This mechanism creates an endogenous feedback loop in which congestion influences operational delay, and operational delay further modifies passenger decisions. The simulation operates in discrete time steps synchronized with train movements to ensure coherence between behavioral and operational processes.
Model calibration relied on historical disruption episodes to align simulated congestion patterns with observed railway performance. Sensitivity analyses were conducted to assess robustness under varying passenger demand intensities and disruption magnitudes. Simulation outputs–including occupancy rates, platform density levels, extended dwell durations, and secondary delays–are transmitted directly to the optimization module.
3.4 Dynamic timetable reoptimization and validation strategy
The dynamic timetable reoptimization module constitutes the decision-making core of the proposed framework. Its primary objective is to transform predictive delay outputs and passenger congestion estimates into operationally feasible timetable adjustments that enhance network resilience while maintaining service reliability. Unlike static rescheduling approaches, the proposed model operates within a feedback-driven structure in which updated system states continuously inform subsequent scheduling decisions.
The reoptimization process is triggered whenever predicted delays exceed predefined operational thresholds or when simulated passenger congestion levels indicate potential capacity saturation. In this study, threshold values are defined based on operational relevance, with delay thresholds set at 15 minutes and congestion thresholds associated with high platform occupancy levels, ensuring timely activation of corrective actions.
The decision logic integrates both infrastructure constraints (headway limitations, track capacity, station dwell time bounds) and passenger-centered performance indicators (crowding levels, missed connections, platform accumulation rates).
The optimization problem is formulated as a constrained multi-objective adjustment model. The objective function is defined as:
Where: : propagated delays; : passenger waiting time; : congestion levels; : timetable deviations
The model is subject to operational constraints including minimum headway requirements, dwell time limits, rolling stock circulation constraints, platform capacity limitations, and turnaround time restrictions.
Instead of performing a full timetable reconstruction, the model applies localized corrective strategies, such as controlled holding, departure time shifting, selective train overtaking (when infrastructure permits), and dwell time recalibration based on simulated boarding pressure.
To ensure computational tractability in real-time operational environments, the model adopts an iterative heuristic adjustment mechanism rather than a full-scale mixed-integer reoptimization at every disturbance. At each iteration, updated delay predictions and congestion indicators are re-evaluated, and only the most critical conflicts are addressed. This rolling-horizon logic significantly reduces computational burden while preserving responsiveness.
The validation strategy follows a comparative scenario-based evaluation. 3 operational scenarios are simulated: (1) baseline timetable without AI intervention, (2) delay prediction without passenger behavioral integration, and (3) the fully integrated predictive-simulation-reoptimization framework.
These 3 scenarios are deliberately designed to isolate the marginal contribution of each component of the proposed framework. The baseline scenario represents existing operational conditions, the second scenario evaluates the standalone contribution of predictive delay modeling, and the third scenario captures the full integrated system. This incremental design ensures internal validity and allows a clear interpretation of the role of each module.
The experimental procedure follows a structured sequence including initialization of operational conditions, application of identical disruption inputs, execution of the corresponding model configuration, and evaluation using predefined performance indicators.
Performance is assessed using resilience-oriented indicators, including average delay per train, total passenger waiting time, congestion intensity index, timetable stability ratio, and delay recovery time. Statistical comparison across scenarios enables isolation of the marginal contribution of passenger-behavior modeling within the reoptimization loop.
Sensitivity analyses are additionally conducted to evaluate robustness under varying disruption magnitudes and passenger demand volatility. Overall, the dynamic timetable reoptimization module operates as a closed-loop adaptive mechanism that bridges predictive analytics and operational control. By jointly considering infrastructure constraints and passenger behavioral dynamics, the framework advances beyond traditional delay recovery models and contributes to a more resilient, passenger-centered railway timetable management strategy.
4. Results and discussion
4.1 Results of predictive delay modeling
The first stage of empirical validation concerns the predictive delay modeling module described in Section 3.2. As outlined in the methodology, supervised learning algorithms were trained on synchronized and preprocessed operational data collected from commuter services connecting Casablanca, Mohammedia, and Rabat. Feature engineering included upstream cumulative delay indicators, headway variability, rolling stock dependencies, and congestion proxy variables. The objective was not merely statistical prediction accuracy, but operationally meaningful anticipation of primary disruptions before their systemic propagation.
Two models were evaluated: an ensemble tree-based regressor and a RNN. Their performance metrics on the temporally separated test dataset are summarized in Table 2.
The RNN demonstrated superior predictive capability, particularly in capturing temporal interdependencies across successive train movements. The improvement in R2 from 0.81 to 0.86 indicates a stronger explanatory capacity regarding delay variance, while the reduction in MAE confirms improved short-term accuracy. More importantly, from an operational standpoint, the RNN generated delay alerts on average 13 minutes prior to the full materialization of disruption impacts at downstream stations. This anticipatory margin proved critical for activating the reoptimization module before congestion thresholds were exceeded.
To further examine model reliability, predicted and observed delays were plotted across peak-hour operations (Figure 4).
The majority of points cluster closely around the identity line, indicating strong alignment. Deviations become more visible for extreme events exceeding 60 minutes, typically associated with rare infrastructure failures or environmental disturbances. These cases highlight a structural limitation of historical learning approaches: predictive reliability decreases for low-frequency, high-impact events. However, because such disruptions represent a minority of operational instances, the overall anticipatory performance remains robust.
A temporal error analysis was also conducted, comparing peak and off-peak periods. Prediction errors during peak hours were approximately 8% higher than during off-peak periods, reflecting the greater complexity of dense traffic conditions. Nevertheless, even under high-demand stress, the model maintained acceptable predictive accuracy. These findings directly respond to RQ1 by demonstrating that artificial intelligence can reliably anticipate primary train delays in high-density Moroccan commuter corridors.
4.2 Results of agent-based passenger simulation
Following delay prediction, the second methodological module–the agent-based passenger simulation–was activated. As described in Section 3.3, passengers were modeled as autonomous agents characterized by arrival time, destination, tolerance threshold, and boarding strategy. The simulation was synchronized with real train movement data to ensure consistency between operational and behavioral processes.
To evaluate congestion dynamics, a disruption scenario involving a 25-min primary delay during peak hours at Casablanca Central Station was simulated. Platform occupancy over time is illustrated in Figure 5.
The results reveal a clear nonlinear congestion pattern. During the first 15 minutes, passenger accumulation follows a moderate linear trend. However, once the delayed train fails to depart as scheduled, passenger density increases sharply, surpassing 90% of carriage capacity within 22 minutes. Beyond this threshold, boarding processes slow significantly, extending dwell times and triggering secondary delays in subsequent services.
The relationship between primary delays, dwell time extensions, and propagated delays is summarized in Table 3.
The data confirm that dwell time extensions are not proportionally linear to primary delay magnitude. Instead, they are mediated by passenger density levels. When occupancy exceeds approximately 85% of available capacity, dwell time increases accelerate sharply. This confirms the endogenous feedback loop hypothesized in the literature review: operational delay generates passenger accumulation, which in turn amplifies operational delay.
Behavioral heterogeneity also played a critical role. Approximately 27% of passengers with lower delay tolerance postponed boarding to later trains, temporarily redistributing congestion. However, high-urgency passengers competed aggressively for boarding space, increasing short-term crowding pressure. The coexistence of these strategies generated emergent congestion patterns that aggregate demand models would fail to capture.
Sensitivity analysis was conducted by increasing passenger demand by 15% and 25% relative to baseline peak levels. Under a 25% demand increase, secondary delays rose by nearly 22%, demonstrating the vulnerability of the system to demand volatility. These findings provide empirical evidence supporting RQ2: incorporating adaptive passenger behavior significantly alters congestion dynamics and delay propagation patterns.
4.3 Results of dynamic timetable reoptimization
The third stage involved activating the dynamic timetable reoptimization module described in Section 3.4. The system was triggered when predicted delays exceeded predefined thresholds (15 minutes) or when simulated platform occupancy surpassed 80% capacity.
Three scenarios were compared: (1) Baseline timetable without AI intervention; (2) Predictive AI without passenger integration; and (3) Fully integrated predictive–behavioral reoptimization framework. The comparative performance indicators are presented in Table 4.
The fully integrated framework achieved a 46% (21.4–11.5/21.4 * 100) reduction in average train delays compared to baseline conditions. Total passenger waiting time decreased by approximately 43%, while congestion intensity was nearly halved. Importantly, timetable stability remained high (95%), indicating that adaptive interventions did not generate excessive scheduling volatility.
The baseline scenario exhibits exponential delay amplification, while the prediction-only scenario moderates the slope but does not eliminate congestion-driven feedback. The integrated framework significantly flattens the propagation curve, demonstrating the effectiveness of the closed-loop architecture (Figure 6).
Localized corrective strategies included controlled holding, minor departure shifts (2–6 minutes), and dwell time recalibration based on boarding pressure. Rather than reconstructing the entire timetable, the system implemented iterative adjustments within a rolling-horizon structure, ensuring computational feasibility. Under stress tests involving simultaneous multi-train disruptions, the integrated framework reduced recovery time by approximately 34% relative to conventional strategies. However, in extreme scenarios involving infrastructure blockages exceeding 90 minutes, improvements were less pronounced, highlighting limitations under severe structural constraints.
The results confirm that railway system resilience cannot be achieved through isolated optimization mechanisms. Predictive accuracy alone reduces primary delay uncertainty but fails to control congestion-driven secondary effects. Similarly, behavioral modeling without anticipatory forecasting would remain reactive rather than preventive. Only when predictive analytics, passenger adaptation modeling, and dynamic reoptimization operate within a unified feedback loop does substantial performance improvement emerge. The empirical findings directly support the theoretical gaps identified in Section 2. Traditional train-centric optimization neglects passenger-induced feedback mechanisms. By incorporating adaptive demand dynamics, the proposed framework addresses this structural limitation and demonstrates measurable operational benefits in Moroccan commuter corridors.
From a managerial perspective, the results suggest that railway operators can enhance service reliability not merely by increasing infrastructure capacity but by deploying intelligent control systems capable of anticipating disruptions and dynamically adjusting schedules in response to behavioral patterns. Nevertheless, extreme environmental events and rare infrastructure failures remain challenging, indicating opportunities for future integration of predictive maintenance systems and broader network redundancy strategies. Overall, the results validate the research hypothesis: integrating artificial intelligence with passenger-centered simulation within a dynamic reoptimization architecture significantly improves railway timetable resilience, reduces secondary delays, and enhances passenger experience in disruption-prone commuter networks.
5. Conclusion
This research set out to examine how artificial intelligence can be operationally integrated into railway timetable management in order to improve resilience in disruption-prone commuter corridors. Focusing on the Moroccan axis linking Casablanca, Mohammedia, and Rabat, the study developed and validated a unified framework combining 3 interdependent components: predictive delay forecasting, agent-based passenger behavior simulation, and dynamic timetable reoptimization. Rather than treating these mechanisms separately, the proposed architecture connected them within a continuous feedback loop, allowing anticipated delays and passenger congestion patterns to directly inform real-time scheduling decisions. Empirical testing using operational data demonstrated that such integration substantially limits the amplification of secondary delays and mitigates congestion effects under peak-hour stress conditions.
The study makes several important contributions to railway operations research. First, it confirms that data-driven predictive models can provide operationally meaningful anticipation of primary delays, offering a critical time window for proactive intervention. Second, it shows that passenger behavior must be modeled as an endogenous component of the system rather than as a fixed external demand parameter. The agent-based simulation reveals nonlinear congestion mechanisms and feedback loops that significantly influence dwell times and delay propagation. Third, by embedding predictive analytics and behavioral modeling within a rolling-horizon reoptimization process, the research advances a passenger-centered, adaptive control approach that moves beyond traditional train-centric scheduling models. The empirical results demonstrate notable reductions in average delay, passenger waiting time, and congestion intensity, while preserving timetable stability–highlighting the effectiveness of the integrated strategy.
From a managerial perspective, the findings suggest that improving railway performance does not necessarily require major infrastructure expansion. Intelligent decision-support systems capable of anticipating disruptions and dynamically adjusting operations can generate meaningful efficiency gains within existing capacity constraints. The framework also provides railway operators with a structured method for balancing punctuality, congestion control, and timetable stability, particularly in high-density commuter environments.
Nevertheless, certain limitations must be acknowledged. The predictive component relies on historical data patterns, which may reduce robustness in the presence of rare, extreme, or unprecedented disruptions. The empirical validation was confined to a specific commuter corridor, potentially limiting the generalizability of the results to other network configurations or long-distance systems. Additionally, the use of heuristic optimization techniques–while necessary for computational feasibility–may not always achieve globally optimal scheduling solutions during large-scale simultaneous disturbances.
Future research could expand this work by extending the framework to multi-line or national-scale railway networks and by incorporating predictive maintenance and infrastructure health monitoring systems to better address low-frequency, high-impact events. Further methodological advancements may include reinforcement learning approaches that continuously adapt based on real-time operational feedback and live passenger flow data. Integrating passenger information systems into the behavioral module could also refine the representation of decision-making under uncertainty. By deepening the integration between predictive intelligence, behavioral dynamics, and adaptive scheduling, future studies can continue to strengthen the resilience and passenger orientation of modern railway systems.







