app.state.schedule

The planned schedule: every vehicle’s stop visits for the day, indexed for arrival detection.

schedule_plan.csv rows are planned visits: tt_action_item_id identifies one visit (the same id the ML contract calls target_stop_id), building_address is the only stop name there is. A planned gap longer than TRIP_GAP_S between consecutive visits is a terminal: a new trip begins.

Functions

load_schedule(path)

Classes

StopVisit(pos, stop_id, plan, lat, lon, ...)

VehicleSchedule(tr_id, visits)

class app.state.schedule.StopVisit(pos: 'int', stop_id: 'int', plan: 'datetime', lat: 'float', lon: 'float', manual_fill: 'bool', name: 'str', geom: 'str', trip: 'int', idx_in_trip: 'int')[исходный код]

Базовые классы: object

__init__(pos: int, stop_id: int, plan: datetime, lat: float, lon: float, manual_fill: bool, name: str, geom: str, trip: int, idx_in_trip: int) → None
geom: str
idx_in_trip: int
property label: str

the address, or a placeholder where the dataset has none.

Type:

What the dispatcher sees

lat: float
lon: float
manual_fill: bool
name: str
plan: datetime
pos: int
stop_id: int
trip: int
class app.state.schedule.VehicleSchedule(tr_id: 'int', visits: 'list[StopVisit]')[исходный код]

Базовые классы: object

__init__(tr_id: int, visits: list[StopVisit]) → None
cum_dist_m: numpy.ndarray
first_after(t_s: int) → int | None[исходный код]

Position of the first visit planned strictly after t_s.

lat: numpy.ndarray
lon: numpy.ndarray
mf: numpy.ndarray
plan_s: numpy.ndarray
tr_id: int
visits: list[StopVisit]
app.state.schedule.load_schedule(path: Path) → dict[int, VehicleSchedule][исходный код]