[−][src]Struct sim::transit::TransitSimState
Manages public transit vehicles (buses and trains) that follow a route. The transit model is currently kind of broken, so not describing the state machine yet.
Fields
buses: BTreeMap<CarID, Bus>
routes: BTreeMap<BusRouteID, Route>
peds_waiting: BTreeMap<BusStopID, Vec<(PedestrianID, BusRouteID, Option<BusStopID>, Time)>>
waiting at => (ped, route, bound for, started waiting)
events: Vec<Event>
Implementations
impl TransitSimState
[src]
pub fn new(map: &Map) -> TransitSimState
[src]
pub fn create_empty_route(&mut self, bus_route: &BusRoute, map: &Map) -> Path
[src]
Returns the path for the first leg.
pub fn bus_created(&mut self, bus: CarID, r: BusRouteID)
[src]
pub fn bus_arrived_at_stop(
&mut self,
now: Time,
id: CarID,
trips: &mut TripManager,
walking: &mut WalkingSimState,
ctx: &mut Ctx<'_>
) -> bool
[src]
&mut self,
now: Time,
id: CarID,
trips: &mut TripManager,
walking: &mut WalkingSimState,
ctx: &mut Ctx<'_>
) -> bool
If true, the bus is idling. If false, the bus actually arrived at a border and should now vanish.
pub fn bus_departed_from_stop(&mut self, id: CarID, map: &Map) -> Router
[src]
pub fn ped_waiting_for_bus(
&mut self,
now: Time,
ped: PedestrianID,
trip: TripID,
person: PersonID,
stop1: BusStopID,
route_id: BusRouteID,
maybe_stop2: Option<BusStopID>,
map: &Map
) -> Option<CarID>
[src]
&mut self,
now: Time,
ped: PedestrianID,
trip: TripID,
person: PersonID,
stop1: BusStopID,
route_id: BusRouteID,
maybe_stop2: Option<BusStopID>,
map: &Map
) -> Option<CarID>
Returns the bus if the pedestrian boarded immediately.
pub fn collect_events(&mut self) -> Vec<Event>
[src]
pub fn get_passengers(&self, bus: CarID) -> &Vec<(PersonID, Option<BusStopID>)>
[src]
pub fn bus_route(&self, bus: CarID) -> BusRouteID
[src]
pub fn buses_for_route(&self, route: BusRouteID) -> Vec<(CarID, Option<usize>)>
[src]
also stop idx that the bus is coming from
pub fn active_vehicles(&self) -> (usize, usize)
[src]
(buses, trains)
pub fn get_people_waiting_at_stop(
&self,
at: BusStopID
) -> &Vec<(PedestrianID, BusRouteID, Option<BusStopID>, Time)>
[src]
&self,
at: BusStopID
) -> &Vec<(PedestrianID, BusRouteID, Option<BusStopID>, Time)>
pub fn get_unzoomed_transit_riders(
&self,
now: Time,
driving: &DrivingSimState,
map: &Map
) -> Vec<UnzoomedAgent>
[src]
&self,
now: Time,
driving: &DrivingSimState,
map: &Map
) -> Vec<UnzoomedAgent>
Trait Implementations
impl Clone for TransitSimState
[src]
fn clone(&self) -> TransitSimState
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'de> Deserialize<'de> for TransitSimState
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for TransitSimState
[src]
Auto Trait Implementations
impl RefUnwindSafe for TransitSimState
impl Send for TransitSimState
impl Sync for TransitSimState
impl Unpin for TransitSimState
impl UnwindSafe for TransitSimState
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,