A discrete-time simulation of a taxi boarding system that models passenger arrivals, waiting queues, dynamic taxi capacities, and boarding delays using queues and structured data in C++.
This project simulates how passengers are served by taxis on three different routes under time-varying capacity constraints.
Each passenger:
Each taxi:
The simulation prints a time-step table showing system state at each moment.
| Route Code | Description |
|---|---|
| S | Short Route |
| L | Long Route |
| C | City Route |
Each route has:
Passenger data is read from a file:
taxiData.txt
arrival_time,route_type,boarding_time
Example: 2,S,3 4,L,2 6,C,4
At each time unit the system performs:
Taxi capacity changes over time to simulate:
Example:
```cpp
vector
🧩 Key Data Structures Used
Structure Purpose
queue
Event-driven systems
Time-step iteration
Resource capacity constraints
File parsing and validation
Memory management (new / delete)
Formatted tabular output
🖥 Sample Output (Simplified) T next S L C WQS WQL WQC CS CL CC 0 S0(2) S0(2) 4 5 5 1 S0(1) 2 L2(1) L2(1) 3 C3(2) C3(2) Each row shows:
Current time
New arrivals
Currently boarding passengers
Waiting queues
Available seats per taxi
▶ How to Compile & Run Compile g++ main.cpp -o taxi_sim Run ./taxi_sim ⚠️ Ensure the input file path is correct:
“C:\data\taxiData.txt” (Change this if running on Linux or macOS.)
🎯 Learning Outcomes This project demonstrates:
Practical use of queues
Simulation of real-world systems
Structured program design
Time-based system modeling
File-based input processing
🚀 Possible Extensions Remove hardcoded file path
Add statistics (average wait time)
Replace static capacities with AI prediction
Visualize simulation output
Support more routes dynamically
👨💻 Author Phumudzo Matshaya
🤖 AI Assistance Disclosure AI tools were used to assist with:
Queue-based simulation logic
File parsing techniques
Output formatting