
π Railways & Public Transport Β· Sequence
How a metro fare is charged with a smart card or bank card: tap in at the entry gate, tap out at the exit, fare by distance and balance update.
Drawing diagramβ¦
Metro fare sequence: at the entry gate the rider taps an NCMC card; the gate reader checks the card offline, writes the entry station and time on the card and opens. At the exit gate the reader reads the entry station, calculates the distance fare, deducts it from the card balance and opens. Both gates send transactions to the station computer, which forwards them to the central clearing system for settlement with the card-issuing bank.
sequenceDiagram actor R as Rider participant EG as Entry Gate participant XG as Exit Gate participant SC as Station Computer participant CC as Central Clearing participant BK as Card Issuing Bank R->>EG: Tap card EG->>EG: Check card offline, write entry station EG-->>R: Gate opens EG->>SC: Entry transaction R->>XG: Tap card at exit XG->>XG: Read entry, calculate fare, deduct balance XG-->>R: Gate opens, balance shown XG->>SC: Exit transaction SC->>CC: Upload transactions CC->>BK: Settle fares
A railway reservation system in the style of IRCTC: seat inventory per train and class, waitlists, Tatkal quota, payments and e-tickets.
The states of a train ticket from booking to journey, including RAC and waitlist confirmation and cancellation.
How a city bus app shows live bus positions and arrival times: GPS devices on buses, a prediction model and updates to apps and stop displays.
How a modern railway signalling network is connected: interlocking at stations, track circuits, train control radio and the central traffic control centre.
A journey planner that combines metro, bus, suburban train and last-mile options into one trip plan with a single ticket.
Tables for train operations: trains, routes, stations, scheduled stops, coaches and daily running with actual times.