Project Overview
This project simulates a public transport boarding environment where passengers arrive over time and are assigned to different taxi types. The system tracks queues, boarding, and departures, producing clear console logs to show how scheduling decisions affect flow and efficiency.
Why I Built This Project
I built this project to practice turning a real-world problem (crowded transport queues) into a structured software model. I wanted hands-on experience with queues, time-based logic, and writing clean, testable simulation code.
It also helped me improve how I explain system behavior through logs—something that’s important when debugging and presenting results.
Problem Statement
In real public transport systems, unmanaged queues can cause delays, unfair boarding, and confusion—especially when multiple vehicle types and passenger priorities exist. A structured queue-based approach can improve fairness and reduce congestion.
This simulation explores how queue rules, priorities, and vehicle capacity affect boarding efficiency and departure timing.
Technologies Used
- C++ for core simulation logic
- STL containers (queue, vector) for managing passengers and state
- Object-Oriented Design for structuring passengers and taxis
- Console logging to visualize system events and debugging output
Key Features
- Multiple taxi types (e.g., S, L, C) with different queue behavior / capacity logic
- Priority boarding rules based on passenger type
- Time-based simulation loop (arrivals, boarding, departure events)
- Clear console output showing the system state at each time step
- Reusable, modular structure (easy to extend with new rules)
My Role in the Project
- Designed passenger + taxi structures and the overall simulation flow
- Implemented queue management and priority boarding rules
- Built the time-step event loop (arrivals → boarding → departures)
- Created readable logs to trace decisions and debug the simulation
Challenges Faced
- Managing multiple queues at the same time while keeping the logic fair and consistent
- Correctly synchronizing time-based events (arrivals, boarding time, and departure triggers)
- Preventing edge-case bugs (e.g., boarding when a taxi is already full, or skipping passengers)
- Designing console output that reflects the system state without becoming unreadable
What I Learned
- How queue-based scheduling models real-world systems (transport, call centers, service lines)
- How to structure simulations with clear state transitions
- How to use STL queues effectively and safely
- How to debug logic-heavy programs using reliable logging
Project Access
The complete source code for this project is hosted on GitHub:
- GitHub Repository: View Source Code
This is a C++ console application and can be compiled locally using a standard C++ compiler.
How to Run the Project
git clone https://github.com/Phumudzo2006/PublicTransportQueue.git
cd PublicTransportQueue
# If your main file is main.cpp:
g++ main.cpp -o transport
./transport
# If your project has multiple .cpp files:
# g++ *.cpp -o transport
# ./transport
If your main file is not main.cpp, replace it with the correct filename (or use the *.cpp option).
Sample Output
PUBLIC TRANSPORT QUEUE SYSTEM
-----------------------------
Time: 0 | Arrivals: S0(3) L0(5)
Taxi S: Boarding S0(3)
Taxi L: Boarding L0(5)
Time: 1 | Arrivals: C1(4)
Taxi C: Boarding C1(4)
Time: 5 | Taxi S FULL — Departing
Time: 6 | Taxi L FULL — Departing
Time: 7 | Taxi C FULL — Departing
Future Improvements
- Add a GUI dashboard (Qt) to visualize queues and departures in real time
- Introduce analytics (average wait time, queue length over time, throughput)
- Support configurable rules (capacity, priorities, boarding time) via a config file
- Persist simulation results to file for reporting