Single Agent Robust Deep Reinforcement Learning for Bus Fleet Control

Yifan Zhang · DOI

TL;DR

Researchers have developed a robust single-agent reinforcement learning (RL) framework that solves the "bus bunching" problem more effectively than complex multi-agent systems. By using categorical embeddings to represent different vehicles and stations, the model learns a unified, stable control policy that outperforms traditional benchmarks in realistic, high-variance transit environments.

What Problem Does This Paper Address?

If you’ve ever waited ages for a bus only to have three arrive at once, you’ve experienced bus bunching. This is a classic "positive feedback loop" failure: a slightly delayed bus picks up more passengers, which delays it further (the "slow get slower" effect), while the bus behind it finds fewer passengers and speeds up (the "fast get faster" effect).

Most modern AI solutions use Multi-Agent Reinforcement Learning (MARL), treating each bus as an independent learner. However, MARL struggles in the real world. Real bus lines aren't just simple loops; they are bidirectional and follow strict timetables. This creates a "data imbalance" problem: a bus that only runs during the morning rush hour accumulates far less experience than one running all day, leading to unstable learning and poor coordination.

Methods

The authors propose a "Single-Agent Robust Deep Reinforcement Learning" framework. Instead of many agents learning separately, one central agent (using the Soft Actor-Critic (SAC) algorithm) controls the entire fleet.

Key innovations include:

  • Categorical Feature Augmentation: The state space is augmented with learnable embeddings for bus_id, station_id, time_period, and direction. This allows the single agent to distinguish between different contexts, effectively projecting a complex multi-agent problem into a higher-dimensional space where a single policy can generalize across the whole fleet.
  • Ridge-Shaped Reward Function: Rather than using simple exponential penalties for being off-schedule, the authors designed a "ridge-shaped" reward. This incentivizes two things simultaneously: maintaining uniform gaps between buses (headway) and adhering to the published timetable.
  • Event-Driven Asynchronicity: Unlike standard RL that ticks at fixed time intervals, this model makes decisions only when a bus completes its passenger exchange at a stop. This matches the actual operational constraints of transit systems.
  • Robustness via Entropy: The authors leverage a theoretical link showing that SAC’s maximum-entropy objective (which encourages exploration) is mathematically equivalent to solving a robust RL problem under uncertainty.

Datasets

The study uses a custom-built, discrete-event simulation environment implemented in Python 3.8. The simulation is grounded in realistic data:

  • Passenger Demand: Hourly Origin-Destination (OD) matrices with Poisson-distributed arrivals.
  • Traffic Dynamics: Segment-specific average speeds with Gaussian noise to simulate congestion and signal delays.
  • Route Structure: A bidirectional corridor with 22 stops (including terminals).
  • Timetable: A 13-hour service window (06:00 to 19:00) with buses dispatched every 6 minutes.

Key Insights and Ideas

  • The "Kernel Trick" for RL: By adding categorical IDs to the state, the authors treat the problem like a kernel method in machine learning. Linearly inseparable patterns (the conflicting needs of different buses) become separable when mapped to a higher-dimensional feature space.
  • Solving Data Imbalance: Because all buses contribute to a single shared replay buffer, the model learns from the collective experience of the fleet. This prevents the "peak-only" buses from having sub-optimal policies.
  • Simplicity Wins: The single-agent approach circumvents the "non-stationarity" problem of MARL (where the environment changes because other agents are also learning), leading to much faster and more reliable convergence.

Key Results

The proposed Embedding-SAC was compared against MADDPG (a popular multi-agent baseline), DDPG, and TD3.

  • Superior Rewards: Under high-stochasticity conditions ($\sigma=2.0$), SAC achieved a mean reward of approximately -430k, significantly better than MADDPG’s -530k and the uncontrolled baseline of -980k.
  • Faster Convergence: SAC reached stable, high rewards in just 30 episodes, whereas MADDPG variants required 150 to 180 episodes to plateau.
  • Robustness: While deterministic algorithms like DDPG and TD3 "collapsed" (suffering catastrophic reward drops) as traffic noise increased, SAC’s performance degraded gracefully, maintaining service regularity even in messy environments.
  • Visual Proof: Trajectory visualizations showed that while uncontrolled scenarios resulted in frequent red-zone bunching events, the SAC-controlled scenario maintained near-perfect spacing throughout the 13-hour day.

Limitations and Future Work

The authors acknowledge several areas for expansion:

  • Non-Stationary Demand: The current model assumes demand patterns are somewhat predictable; future work will look at more volatile, non-stationary demand distributions.
  • Transfer Learning: Testing if a policy learned on one corridor can be "transferred" to a different city or route with minimal retraining.
  • Network Complexity: Moving from a single bidirectional corridor to complex, intersecting transit networks.
  • Graph Models: Exploring latent-graph models to better capture the causal links between buses in a fleet.

Summary updated

Abstract

Bus bunching remains a challenge for urban transit due to stochastic traffic and passenger demand. Traditional solutions rely on multi-agent reinforcement learning (MARL) in loop-line settings, which overlook realistic operations characterized by heterogeneous routes, timetables, fluctuating demand, and varying fleet sizes. We propose a novel single-agent reinforcement learning (RL) framework for bus holding control that avoids the data imbalance and convergence issues of MARL under near-realistic simulation. A bidirectional timetabled network with dynamic passenger demand is constructed. The key innovation is reformulating the multi-agent problem into a single-agent one by augmenting the state space with categorical identifiers (vehicle ID, station ID, time period) in addition to numerical features (headway, occupancy, velocity). This high-dimensional encoding enables single-agent policies to capture inter-agent dependencies, analogous to projecting non-separable inputs into a higher-dimensional space. We further design a structured reward function aligned with operational goals: instead of exponential penalties on headway deviations, a ridge-shaped reward balances uniform headways and schedule adherence. Experiments show that our modified soft actor-critic (SAC) achieves more stable and superior performance than benchmarks, including MADDPG (e.g., -430k vs. -530k under stochastic conditions). These results demonstrate that single-agent deep RL, when enhanced with categorical structuring and schedule-aware rewards, can effectively manage bus holding in non-loop, real-world contexts. This paradigm offers a robust, scalable alternative to MARL frameworks, particularly where agent-specific experiences are imbalanced.
BibTeX
@misc{zhang2025single,
  author = {Yifan Zhang},
  title = {{Single Agent Robust Deep Reinforcement Learning for Bus Fleet Control}},
  year = {2025},
  eprint = {2508.20784},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.20784},
}
Figure