Dynamic Train Schedule Optimization RL Approach using RDDL Environments

Managing platform passenger flow is a critical operational challenge for modern urban rail systems, where frequent fluctuations in arrivals cause train disruptions and unsafe crowding. A novel real-time control system is introduced to regulate unpredictable passenger dynamics and optimize train schedules within stochastic urban transit environments. Modeling the rail network as a Markov Decision Process (MDP), the system utilizes a Python-based Gym simulation environment and integrates a two-part framework. First, a deterministic optimization module applies mathematical constraints via Scipy to generate an optimal baseline timetable aimed at minimizing delays. Second, a real-time regulation module trains a Deep Reinforcement Learning agent using the Proximal Policy Optimization (PPO) algorithm. Operating as a dynamic controller, the agent adjusts train speeds in real-time to suppress stochastic noise and minimize schedule deviations while maintaining strict operational safety. Results demonstrate that the simulation environment successfully replicates complex passenger-train dynamics, boarding/alighting rates, and station capacities. Furthermore, the trained PPO agent exhibits robust capability in tracking the baseline schedule and smoothing passenger distribution across platforms, even during unexpected traffic spikes.