Show HN: NYC Subway Simulator and Route Designer

buildmytransit.nyc

162 points by HeavenFox 20 hours ago

Hello HN!

As a long term NYC resident, I have read countless articles on ideas tweaking subway services, but always found them hard to follow without visual aid. So over the long weekend I decided to build one. It has all the basic features: trains would spawn at their origin, stop at stations, and slow down if it gets too close to another. You can also design custom routes by piecing tracks together.

Have fun, and let me know what you think!

avianlyric 13 minutes ago

Your default dwell times are wayyyyy too short.

On high capacity systems, train dwell time becomes the limiting factor on passenger capacity. 30 seconds is generally the minimum possible dwell time a system can manage, 20 seconds might be possible during much lower demand periods. But you’re unlikely to ever achieve better than that.

The London Victoria Line, which runs with 90 second headways at peak, achieves at best 24 second dwell times in central section, but 30-40 seconds is more realistic for most stations.

Don’t forget, dwell time includes more than just passengers getting off and on. It has to include time to open the doors, close the doors (including a 2-3 second visual and audible warning!), perform needed safety checks, and eventually pull away. Those operational components the sandwich the core “people getting on and off” bit of station stops add up to a non-trivial number of seconds.

https://www.researchgate.net/figure/Dwell-Time-and-Passenger...

As a minor note, the NYC subway uses a system of fix automatic blocks, not a moving block system, which is what your simulation appears to use. Moving block systems are dramatically more efficient than fixed block systems. But I have no idea how you would get hold of accurate block locations for the NYC subway.

darthplagius 14 hours ago

I contract out work to MTA, specifically their AI/ innovation teams.

I'm 100% showing this to them today just for fun. They'll get a kick out of it.

konsalexee an hour ago

I love it! Amazing work.

A slider to do a bit of time-travelling if possible would be also a nice to have

blehn 10 hours ago

I want to love this but the visual language makes it kind of unusable for me. Why not match the track and train colors to their line color (red for the 123) and then use different visual indicators for train state (stopped, at station, etc)?

For example: Selected: Black fill Normal operation: Color fill with 100% opacity Slowing down: 70% opacity Stopped: striped fill, 50% opacity At station: pulsing opacity

  • HeavenFox 8 hours ago

    That is a good idea. I just added color for the tracks. I'm in the process of redesigning how trains look like.

Aaronstotle 11 hours ago

Finally, I will make a subway that crosses the park!

  • evanb 10 hours ago

    92nd and Broadway, CPW, 5th Ave, Lex, 2nd Avenue, follow Astoria Blvd to the Grand Central to LGA is a no-brainer.

kiwibyproxy 15 hours ago

Very cool! It would be nice to have a bit more information in the readme about the project structure and e.g. how to adapt it for other cities :)

  • HeavenFox 7 hours ago

    I just tested it out. Since this uses OpenStreetMap data, it is very easy to adapt to other cities.

    All input data and scripts are in src/data. Run the two Overpass queries, replacing New York with a city of your choice, and you will get JSON data on the infrastructure, as well as services. Replace the two existing JSON files, run the two transformation scripts, and you are done.

xnx 20 hours ago

Very cool.

Sometimes when I Edit Routes and click an "<- Add" button I get the console error "Uncaught Error: coordinates must be an array of two or more positions" and the page blanks out.

  • HeavenFox 19 hours ago

    Thanks - this is likely due to adding two tracks facing each other, i.e.

    -->-->-- --<--<--

    I'll add some logic to prevent such options from showing up.

indoordin0saur 13 hours ago

Very nice! I thought of doing the same thing in the past!

shiroiuma 4 hours ago

What's the point of designing custom routes, except I guess for fun? NYC is never going to build any new routes.

  • HeavenFox 4 hours ago

    That is actually the idea. In this simulator, you design services that run on existing tracks. NYC subway is unique in the world in that there are a ton of interlining as well as quadruple tracks, so there are plenty of opportunity to improve system efficiency without building anything new.

ars 13 hours ago

I can't figure out how to add a route from Bay Ridge to Clinton in NJ. That's my wishlist subway - got to Newark Airport from Brooklyn without going through Manhattan.

Edit: Actually Clifton is in NY, and playing with Google maps there's ZERO public transport from Staten Island to NJ, except by going through Manhattan!

So my idea wouldn't help anyway, unless they extended that subway all the way over the Goethals Bridge.

  • HeavenFox 13 hours ago

    As a Brooklynite I wholeheartedly agree. Unfortunately this is more of a service designer as opposed to a track designer, and it only works with existing infrastructure :(

  • throwaway2037 9 hours ago

        > ZERO public transport from Staten Island to NJ
    
    I only see three bridges off the island. Can you walk any of them? Hoboken light rail in Bayonne isn't so far.
    • acjohnson55 9 hours ago

      There are 4 bridges: Goethals, Outerbridge, Bayonne, and Verrazano. You can walk on Goethals and Bayonne. I was actually thinking a few weeks ago about walking from Elizabeth to Bayonne someday, just for the heck of it.

    • ars 8 hours ago

      Looks like a 2 or 3 mile walk from the nearest public transport stops that I can find. Maybe someone local can find a closer stop.

      Forest Ave/Goethals Rd North to Bayway Ave at Mckinley St.

      Edit: This could be a fun game - find the two spots with the greatest ratio of driving vs public transport. I think those two are pretty good candidates.

      Distance: 2.5 mile.

      Drive 9AM: 5-9 minutes, 11PM: 4-6 minutes.

      Public transport 9AM: 1:52, 11PM: 3:34.

      Ratio (using the average drive time) 9AM: 16, 11PM: 42.8.

      https://maps.app.goo.gl/WU1jzjYh8tkTCuh87

pimlottc 18 hours ago

This is sadly not mobile friendly in an amusing way; the map controls are nice and legible but they block basically the entire map. If there was a way to minimize them (perhaps automatically), this might work well on mobile.