Skip to content

C++ rewrite of charlietharas/citysim-java. Simulates agents pathfinding around NYC subway.

License

Notifications You must be signed in to change notification settings

charlietharas/citysim-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simulates transit riders in the New York City subway based on annual station ridership data.

Data Sources

https://github.com/CityOfNewYork/nyc-geo-metadata

Line order data

Station ridership data

Future improvements

Possible short term performance improvements:

  • pathfinding
    • path contraction to POIs/line nodes--add nodes along the same line as node neighbors, or add major transfer points (this has previously reduced performance)
    • multithreading/hardware utilization (likely not necessary)
  • citizen update loop
    • delay updates/checks on citizens that aren't expected to get to their destination for a while (some sort of priority queue/other data structure)
    • path contraction post-generation (this has previously created issues and failed to improve performance, but does reduce memory usage significantly)
    • explore options for vectorization/individual update optimization (likely not helpful)

Possibilities for extension:

  • rush hour (!)
  • custom and accurate train counts, speeds (from https://new.mta.info/schedules, The Weekender)
  • tweaks to pathfinding algorithm for better realism
    • dynamically update weights for algorithm using train ETAs (incorporate headways)
      • use D*?
    • adjust algorithm hyperparameters (and add variance to individual agent heuristics) for realistic choice-making
  • drawing "complex lines" instead of straight lines between stations (I already have the data)
    • making trains follow those lines
    • giving trains basic physics (accel, decel, turning)
      • or at least precompute this for realistic headways
  • randomized delays and train backups/queues
  • schedule switching (weekend/late-night/etc.)
  • incorporate other transit modes (e.g. bus)

About

C++ rewrite of charlietharas/citysim-java. Simulates agents pathfinding around NYC subway.

Resources

License

Stars

Watchers

Forks

Languages