Skip to content

Repository files navigation

RailFlow

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.

image

Run Backend

Fast start:

cd RailFlow
.\start.ps1

Clean shutdown:

cd RailFlow
.\stop.ps1

Manual backend start:

cd RailFlow
pip install -r backend\requirements.txt
python -m uvicorn backend.main:app --reload

The API runs at:

http://127.0.0.1:8000

Run Frontend

cd RailFlow\frontend
npm install
npm run dev

The app runs at:

http://127.0.0.1:5173

Local Users

admin / admin
dispatcher / dispatcher
viewer / viewer

PPO Training

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_ppo

The model is saved to:

backend\models\railflow_ppo.zip

About

AI-powered railway traffic control system using graph algorithms and reinforcement learning for optimized scheduling and reduced delays.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages