Skip to main content

Crate rustsim_transit

Crate rustsim_transit 

Source
Expand description

Public-transit primitives for rustsim.

This crate provides the minimum set of types needed to model scheduled shared-ride services (bus, tram, metro, rail, ferry, shuttle) sitting above the generic rustsim-traffic link network. It is deliberately agnostic to how a transit vehicle physically moves (that is delegated to rustsim-vehicle or a custom controller) — it only models the service layer.

Core concepts:

  • Stop — a named point in space with a finite capacity for waiting passengers.
  • Route — an ordered sequence of stops with a scheduled headway or explicit departure times.
  • TransitVehicle — a service instance with a capacity and a list of current passenger IDs.
  • Boarding — FIFO queue discipline at each stop.
  • Schedule — either a fixed-headway or explicit-timetable departure pattern.
  • dwell — a linear dwell-time model used to compute how long a vehicle sits at a stop.
  • policy — explicit queue, dispatch, and dwell policy contracts.

Re-exports§

pub use boarding::Boarding;
pub use boarding::BoardingResult;
pub use boarding::Waiter;
pub use dwell::DwellParams;
pub use dwell::DwellTime;
pub use policy::board_with_policy;
pub use policy::BoardingPolicy;
pub use policy::CapacityStopQueuePolicy;
pub use policy::DispatchContext;
pub use policy::DispatchDecision;
pub use policy::DispatchPolicy;
pub use policy::DwellPolicy;
pub use policy::FifoBoardingPolicy;
pub use policy::LinearDwellPolicy;
pub use policy::ScheduledDispatchPolicy;
pub use policy::StopQueuePolicy;
pub use route::Route;
pub use route::RouteId;
pub use schedule::Departure;
pub use schedule::Schedule;
pub use stop::Stop;
pub use stop::StopId;
pub use vehicle::TransitVehicle;
pub use vehicle::VehicleId;

Modules§

boarding
Boarding queues and FIFO service discipline at transit stops.
dwell
Dwell-time models for transit vehicles at stops.
policy
Transit queue, dispatch, and dwell policies.
prelude
Convenience re-exports.
route
Transit routes: an ordered sequence of stops plus a schedule.
schedule
Departure schedules: fixed headway or explicit timetable.
stop
Transit stops.
vehicle
Transit vehicles: service instances riding a route.

Type Aliases§

PassengerId
Agent identifier — mirrors rustsim_core::AgentId.