# singhsatwik/dmrc_simulator architecture

> Architecture diagram of the GitHub repository singhsatwik/dmrc_simulator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/singhsatwik/dmrc_simulator
- Repository: https://github.com/singhsatwik/dmrc_simulator

## Overview

Delhi Metro Route Planner is a menu-driven Python application for checking train arrivals, planning journeys, and calculating fares. Its principal workflow accepts station and time input, normalizes station names, evaluates train schedules and route options, then presents journey details or fare results. The README documents four metro lines, Blue Line branches, interchanges, travel-time estimates, fares, and station shortcuts. The single script excerpt shows the menu, schedule and route calculations, and fare logic; the documented data-file relationship is supported by the README.

Main entry points: [`metro_simulator.py`](https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py) (Menu and input), [`metro_data.txt`](https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_data.txt) (Metro data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User interaction"]
  node_menu["Menu and input<br/>[metro_simulator.py]"]
  node_station_names["Station shortcuts<br/>[metro_simulator.py]"]
  node_journey_output["Journey results<br/>[metro_simulator.py]"]
end

subgraph group_network["Metro network"]
  node_metro_data["Metro data<br/>[metro_data.txt]"]
  node_network_model["Line and station model<br/>[metro_simulator.py]"]
end

subgraph group_journeys["Journey calculations"]
  node_arrival_check["Next metro lookup<br/>[metro_simulator.py]"]
  node_schedule_engine["Train schedule engine<br/>[metro_simulator.py]"]
  node_route_planner["Journey planner<br/>[metro_simulator.py]"]
  node_interchange_search["Interchange search<br/>[metro_simulator.py]"]
  node_travel_time["Travel-time estimate<br/>[metro_simulator.py]"]
  node_fare_calc["Fare calculator<br/>[metro_simulator.py]"]
end

node_rider(("Rider"))

node_rider -->|"enters choices"| node_menu
node_menu -->|"dispatches lookup"| node_arrival_check
node_menu -->|"dispatches journey"| node_route_planner
node_menu -->|"dispatches fare"| node_fare_calc
node_menu -->|"normalizes input"| node_station_names
node_metro_data -->|"provides station data"| node_network_model
node_arrival_check -->|"queries arrivals"| node_schedule_engine
node_route_planner -->|"checks train times"| node_schedule_engine
node_route_planner -->|"checks transfers"| node_interchange_search
node_route_planner -->|"estimates duration"| node_travel_time
node_fare_calc -->|"uses duration"| node_travel_time
node_menu -->|"prints results"| node_journey_output
node_route_planner -->|"reports route"| node_journey_output
node_fare_calc -->|"reports fare"| node_journey_output

click node_menu "https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py"
click node_station_names "https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py"
click node_metro_data "https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_data.txt"
click node_network_model "https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py"
click node_arrival_check "https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py"
click node_schedule_engine "https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py"
click node_route_planner "https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py"
click node_interchange_search "https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py"
click node_travel_time "https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py"
click node_fare_calc "https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py"
click node_journey_output "https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_menu,node_station_names,node_journey_output toneBlue
class node_metro_data,node_network_model toneAmber
class node_arrival_check,node_schedule_engine,node_route_planner,node_interchange_search,node_travel_time,node_fare_calc toneMint
class node_rider toneIndigo
```

## Components

### User interaction

- [Menu and input](https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py): `metro_simulator.py`
- [Station shortcuts](https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py): `metro_simulator.py`
- [Journey results](https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py): `metro_simulator.py`

### Metro network

- [Metro data](https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_data.txt): `metro_data.txt`
- [Line and station model](https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py): `metro_simulator.py`

### Journey calculations

- [Next metro lookup](https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py): `metro_simulator.py`
- [Train schedule engine](https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py): `metro_simulator.py`
- [Journey planner](https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py): `metro_simulator.py`
- [Interchange search](https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py): `metro_simulator.py`
- [Travel-time estimate](https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py): `metro_simulator.py`
- [Fare calculator](https://github.com/singhsatwik/dmrc_simulator/blob/main/metro_simulator.py): `metro_simulator.py`

### Other components

- **Rider**

## Connections

- Rider → Menu and input: enters choices (evidence: `metro_simulator.py`)
- Menu and input → Next metro lookup: dispatches lookup (evidence: `metro_simulator.py`)
- Menu and input → Journey planner: dispatches journey (evidence: `metro_simulator.py`)
- Menu and input → Fare calculator: dispatches fare (evidence: `metro_simulator.py`)
- Menu and input → Station shortcuts: normalizes input (evidence: `metro_simulator.py`)
- Metro data → Line and station model: provides station data (evidence: `README.md`)
- Next metro lookup → Train schedule engine: queries arrivals (evidence: `metro_simulator.py`)
- Journey planner → Train schedule engine: checks train times (evidence: `metro_simulator.py`)
- Journey planner → Interchange search: checks transfers (evidence: `metro_simulator.py`)
- Journey planner → Travel-time estimate: estimates duration (evidence: `metro_simulator.py`)
- Fare calculator → Travel-time estimate: uses duration (evidence: `metro_simulator.py`)
- Menu and input → Journey results: prints results (evidence: `metro_simulator.py`)
- Journey planner → Journey results: reports route (evidence: `metro_simulator.py`)
- Fare calculator → Journey results: reports fare (evidence: `metro_simulator.py`)
