Crate sim

Source
Expand description

The sim crate runs a traffic simulation on top of the map_model. See also https://a-b-street.github.io/docs/tech/trafficsim/index.html.

The simulation is very roughly layered into two pieces: the low-level β€œmechanics” of simulating individual agents over time, and higher-level systems like TripManager and TransitSimState that glue together individual goals executed by the agents.

Helpful terminology:

  • sov = single occupancy vehicle, a car with just a driver and no passengers. (Car passengers are not currently modelled)

Re-exports§

Modules§

  • analytics πŸ”’
  • events πŸ”’
  • make πŸ”’
    Everything needed to setup a simulation.
  • mechanics πŸ”’
  • pandemic πŸ”’
    An experimental SEIR model by https://github.com/omalaspinas/ glued to the traffic simulation. Transmission may occur when people spend time in shared spaces like buildings, bus stops, and buses.
  • recorder πŸ”’
  • render πŸ”’
    Intermediate structures so that sim and game crates don’t have a cyclic dependency.
  • router πŸ”’
    For vehicles only, not pedestrians. Follows a Path from map_model, but can opportunistically lane-change to avoid a slow lane, can can handle re-planning to look for available parking.
  • scheduler πŸ”’
  • sim πŸ”’
  • transit πŸ”’
  • trips πŸ”’

Structs§

Enums§

Constants§

  • BIKE_LENGTH πŸ”’
  • BUS_LENGTH πŸ”’
  • At all speeds (including at rest), cars must be at least this far apart, measured from front of one car to the back of the other.
  • MAX_CAR_LENGTH πŸ”’
  • MIN_CAR_LENGTH πŸ”’
  • SPAWN_DIST πŸ”’
    When spawning at borders, start the front of the vehicle this far along and gradually appear. Getting too close to EPSILON_DIST can lead to get_draw_car having no geometry at all.

Traits§

Functions§