Abstract:Urban rail transit lines are frequently subject to severe directional imbalances in passenger flow during peak periods. Conventional operation modes with fixed train consists and uniform headways are insufficient to accommodate the significant spatiotemporal fluctuations in travel demand. With the advancement of Virtual Coupling (VC) technology, it has become technically feasible for trains to be dynamically coupled and decoupled at stations, providing essential support for flexible train formation and the coordinated operation of full-length and short-turn services. In this paper, the collaborative optimization of train service plans and flexible consist decisions under a combined full-length/short-turn operation mode is investigated. The scheduling problem is formulated as a Markov Decision Process (MDP) that systematically incorporates operational constraints, including timetabling, passenger flow management, rolling stock circulation, and consist adjustments. The objective is to minimize a weighted combination of unserved passenger costs and traction energy consumption, thereby balancing service quality against operational efficiency. The problem is solved using the Proximal Policy Optimization (PPO) algorithm, enhanced with an action masking mechanism that embeds operational constraints directly into the policy sampling process and eliminates the training instability associated with conventional penalty-based approaches. A simulation environment based on real Origin–Destination (OD) demand data from Beijing Metro Line 6 is developed for validation. Numerical results show that the proposed reinforcement-learning-based flexible consist scheme (RL-FC) reduces traction energy consumption by 12.1% relative to the fixed consist benchmark and by an additional 5.8% compared with the rule-based strategy (Rule-FC), while maintaining robust performance across 100 Monte Carlo simulation runs. A Pareto frontier analysis further reveals that setting the service-quality weight within [0.5, 0.8] yields a well-balanced trade-off between passenger service level and energy efficiency.