-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreadme
More file actions
204 lines (139 loc) Β· 6.61 KB
/
Copy pathreadme
File metadata and controls
204 lines (139 loc) Β· 6.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# π Railway Traffic Decision-Support System
## π Overview
Indian Railways currently relies on **manual decision-making** by traffic controllers to manage train precedence, crossings, and scheduling. As traffic grows, manual operations face limitations: increasing congestion, delays, and inefficient use of track capacity.
This project aims to build an **AI + Optimization powered Decision-Support System** to assist section controllers. The system generates **real-time recommendations** for train scheduling, rerouting, and platform allocationβimproving throughput, punctuality, and safety.
---
## π― Problem Statement (Simplified)
* Railways have limited **tracks, signals, and platforms** shared by many trains (passenger, freight, express, special).
* Controllers must decide **which train goes first, which waits, and where to cross**, under numerous constraints:
* Safety rules
* Track capacity
* Platform availability
* Train priorities (e.g., express > freight)
* This is a **large-scale optimization problem** with too many possibilities for human intuition alone.
* Current manual system = delays, bottlenecks, inefficient utilization.
---
## β
Expected Solution (from SIH brief)
An **intelligent decision-support tool** that:
1. Suggests optimal train precedence and crossings in real time.
2. Uses AI/Operations Research to maximize throughput & minimize delays.
3. Quickly re-optimizes during disruptions (breakdowns, weather).
4. Provides **visual dashboards** with delays, station maps, and KPIs.
5. Integrates with existing railway control systems via secure APIs.
---
## π οΈ Our Approach
### πΉ High-Level Workflow
1. **Data Collection**
* Train schedules (NTES, Datameet datasets).
* Real-time train running status (via **Indian Railways MCP API**).
* Section metadata: track length, junctions, gradients, signalling.
2. **State Store**
* Central database (PostgreSQL/TimescaleDB) for live train positions, delays, section status.
3. **Decision Engine**
* **Core algorithm**: Backtracking/Constraint-Satisfaction with pruning.
* **AI layer**: ML models to account for disruptions (historical delay prediction, weather, breakdown probabilities).
* Produces optimized train order, crossing plan, and rerouting suggestions.
4. **Simulation Mode**
* Discrete-event simulator (Python) to **compare baseline vs optimized** schedules.
* Metrics: throughput, average delay reduction, utilization.
5. **Visualization & UI**
* Web-based dashboard (FastAPI + lightweight JS/Plotly).
* Features:
* Station map + live train icons.
* Delays highlighted in colors.
* Single-screen recommendations for operator.
* βWhat-ifβ scenario testing.
---
## π§βπ» Tech Stack
| Component | Technology | Reason |
| -------------- | -------------------------------------------- | ----------------------------------------------------- |
| Backend APIs | **FastAPI (Python)** | Lightweight, async, great for real-time REST APIs |
| Database | **PostgreSQL + TimescaleDB** | Handles historical + real-time time-series train data |
| Optimization | **OR-Tools / PuLP (Python)** | Solvers for combinatorial optimization |
| AI/ML | **XGBoost / PyTorch** | Delay prediction, disruption modeling |
| Real-Time Data | **Indian Railways MCP API** | Live train and station info |
| Caching | **Redis** | Fast updates for real-time status |
| Visualization | **Plotly/D3.js** | Interactive charts and maps |
| Frontend | **Lightweight Web UI** (HTML/JS + Bootstrap) | Minimal, works on railway control room PCs |
| Simulation | **Discrete-event simulator in Python** | Test baseline vs optimized outcomes |
---
## π Key Features
* **Dashboard View**
* Station map with train movements.
* Live delays highlighted (red/yellow).
* Recommendations (text + visuals).
* **Scenario Analysis**
* Try alternative precedence orders.
* Predict impact on throughput.
* **Real-Time Optimization**
* Updates recommendations every few seconds.
* Re-optimizes under delays or disruptions.
* **Integration Ready**
* Exposes APIs to integrate with signalling & TMS.
---
## π Workflow Diagram (Conceptual)
```
[ MCP API / Schedules / Metadata ]
β
Data Collector
β
[ Database ]
β
Decision Engine (OR-Tools + AI)
β
[ Recommendations ]
β
Web Dashboard for Controller
```
---
## π Validation Plan
1. **Use Historical Delay Datasets**
* Run baseline vs optimized schedule.
* Show throughput/delay improvements.
2. **Use MCP Real-Time Data**
* Feed live updates to the system.
* Run side-by-side simulation to show real improvements.
3. **Metrics to Track**
* π Section throughput β (trains handled/hour).
* β±οΈ Average train delay β.
* π Platform utilization β.
Example Claim (Prototype Level):
> *βIn Section X, throughput improved by 18% and average delays reduced by 55% when controller followed system recommendations.β*
---
## π Best Practices in Coding
* **Object-Oriented Design**: Train, Section, Controller as classes.
* **Modular Architecture**: Separate modules for data fetch, optimizer, dashboard.
* **Error Handling**: Robust retries for API calls.
* **Clean Code**: PEP8 guidelines, comments, logging.
* **Version Control**: Git with feature branches.
* **Testing**: Unit tests + simulation-based testing.
---
## π How to Run
1. Clone repo.
2. Install dependencies:
```bash
pip install -r requirements.txt
```
3. Run MCP API server locally (optional for real-time).
4. Start backend:
```bash
uvicorn main:app --reload
```
5. Access dashboard at:
```
http://localhost:8000/dashboard
```
---
## π Future Scope
* Integrate with real signalling systems.
* Expand to multi-section optimization.
* Incorporate reinforcement learning for adaptive decision-making.
* Mobile/Tablet interface for roving controllers.
---
## π₯ Team Roles
* **AI/ML Developer** β Disruption modeling, delay prediction.
* **Optimization Engineer** β OR algorithms, solvers.
* **Backend Engineer** β APIs, database, data adapters.
* **UI Developer** β Dashboard visuals.
* **Systems Integrator** β MCP API, railway systems compatibility.
---