Inspiration

Every day on my commute to school, I face the same problem: a crowd of 30-50 commuters transferring from the train, all trying to get on a single public bus. However, if you miss the immediate transfer, you’re guaranteed another 10-minute wait, which feels like forever for a student trying to get to school on time.

The Root Problem: This issue is caused by static scheduling, a rigid system that many large transportation systems, such as New York City’s MTA, rely on. This system doesn’t account for passenger surges, resulting in buses arriving late and full.

The city of tomorrow, however, does not have this problem, as it utilizes dynamic scheduling. My project aims to showcase this by analyzing transit data to optimize bus schedules, minimizing resource waste during off-peak times, and decreasing wait times for the many commuters trying to get to work or school.


What it does

OmniPulse is a transit simulation engine that optimizes bus deployment by switching from a static timetable to an adaptive, demand-based schedule.

  • The Simulation: It populates a Manhattan bus route with passengers at varying rates, simulating morning, midday, and evening rush hour crowds.
  • Key Metrics: Performance is measured by real-time data: passenger satisfaction, crowding levels, and congestion incidents.
  • Dynamic Mode: OmniPulse analyzes congestion data and upcoming events, such as concerts, to shift bus deployment windows, concentrating the fleet during peak congestion and deploying relief vehicles to prevent overflows.

How I built it

I began by defining the core requirements of my responsive transit optimization system:

  1. A map to display a bus route with its stops and passengers.
  2. A data console to compare static and dynamic scheduling.

The Tech Stack

  • Frontend & Core: React + Vite (for fast, real-time development and highly useful hot reloading).
  • Simulation Engine: A JavaScript loop to handle the core logic.
  • Styling: Tailwind CSS for rapid styling.
  • Mapping & Data Vis: Mapbox GL JS for a custom interactive map of real-world locations, and Recharts to generate responsive, real-time line graphs.

The Development Process

Next, I outlined the application structure and used AI-assisted coding tools, including Cursor and Windsurf, to build out the backbone of the application. I then went into the code myself and developed a more fleshed-out simulation logic representative of real-world transit scenarios. After this, I tweaked the variables using Vite’s hot reloading to ensure the data was accurate and produced convincing results.

To prove the efficiency of dynamic scheduling, I designed the system to run a shadow static simulation in the background simultaneously. This allowed me to collect live comparison metrics that accounted for variance and daily fluctuations within the simulation. Finally, after refining the UI, I deployed the final application using GitHub Pages.


Challenges I ran into

1. Algorithmic Scheduling Logic

To build this reactive scheduling system, I needed to be able to use the previous day’s congestion incidents to refine and adapt the scheduling framework for the following days. At first, this was a daunting task, as I assumed I would need complex logic to meticulously plan out when each bus would be deployed.

  • The Solution: I settled on a much simpler and understandable system that relied on peak windows. After each congestion incident, the time of day is stored, and a buffer is drawn around it to create a time range of increased activity. Overlapping windows are merged to prevent redundancy.
  • The Allocation: This creates periods of increased and decreased activity. Then, 60% of the day’s total bus deployments are assigned to those peak windows, and the remaining 40% is spread across the off-peak periods.

2. The React Strict Mode Bug

Another common challenge for developers, and one that I faced, is debugging. React Strict Mode is a built-in tool that many developers use to highlight potential problems and hidden bugs in their code. I used it too, thinking it would help me, yet ironically, it caused a bug in my code.

React Strict Mode intentionally runs state updater functions twice to help detect unintended side effects. While this has its benefits, it was causing two buses to be deployed as one in my project.

This was a frustrating and confusing bug, but certainly rewarding after I realized what the issue was and got the code up and running again.


Accomplishments that I'm proud of

Building and deploying a complete web application for the very first time has been an incredibly rewarding milestone. Being able to transform this project from an idea into a finished, live product available on the web is awesome and exciting. Web development is an extremely useful tool, and I’m proud to add it to my repertoire.

I will certainly be building more web applications in the future.


What I learned

Working with Mapbox for the first time was an incredible learning experience. After discovering it during my research and implementing it here, it has completely changed how I view simulation design.

  • Real-World Impact: Utilizing actual geographic locations brought an immense level of polish and real-world applicability to the engine. I will definitely be using it in future projects.
  • Expanding Horizons: Being relatively new to web development, this project was a massive eye-opener to the capabilities of the web, which are much higher than I initially assumed.

I now feel inspired to keep pushing the boundaries of what I can build on the web in the future.


What's next for OmniPulse

Systems like mine could be huge in creating the more efficient and intelligent transportation of the future. However, to implement something like this, cities would need to be able to determine how many passengers are waiting throughout the day to respond to it.

This is where real-time video processing and automated passenger counting come into play. This would take live video feeds from bus stops and process them to determine crowd densities, allowing scheduling systems to adapt to them.

While this was beyond what I could get done during this hackathon, it is definitely doable with more time using YOLO, OpenCV, and Python. It is something I’d love to add in the future to show just how applicable dynamic scheduling transit systems are to our societies.

Built With

Share this project:

Updates