RailFlow is a local railway traffic control simulation for the Delhi to Lucknow operating region. It uses a weighted railway graph, deterministic train movement, Dijkstra routing, congestion-aware rerouting, a safe RL wrapper with heuristic fallback, FastAPI, WebSockets, and a React operations console.
Fast start:
cd RailFlow
.\start.ps1Clean shutdown:
cd RailFlow
.\stop.ps1Manual backend start:
cd RailFlow
pip install -r backend\requirements.txt
python -m uvicorn backend.main:app --reloadThe API runs at:
http://127.0.0.1:8000
cd RailFlow\frontend
npm install
npm run devThe app runs at:
http://127.0.0.1:5173
admin / admin
dispatcher / dispatcher
viewer / viewer
The runtime works without a trained PPO model by using the heuristic safety controller. To train a PPO model:
cd RailFlow
pip install -r backend\requirements-rl.txt
python -m backend.train_ppoThe model is saved to:
backend\models\railflow_ppo.zip